Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 558d77f

Browse filesBrowse files
committed
Renaming for new subscripting mechanism
Over at patch https://commitfest.postgresql.org/21/1062/ Dmitry wants to introduce a more generic subscription mechanism, which allows subscripting not only arrays but also other object types such as JSONB. That functionality is introduced in a largish invasive patch, out of which this internal renaming patch was extracted. Author: Dmitry Dolgov Reviewed-by: Tom Lane, Arthur Zakirov Discussion: https://postgr.es/m/CA+q6zcUK4EqPAu7XRRO5CCjMwhz5zvg+rfWuLzVoxp_5sKS6=w@mail.gmail.com
1 parent f831d4a commit 558d77f
Copy full SHA for 558d77f

File tree

Expand file treeCollapse file tree

26 files changed

+559
-527
lines changed
Filter options
Expand file treeCollapse file tree

26 files changed

+559
-527
lines changed

‎contrib/pg_stat_statements/pg_stat_statements.c

Copy file name to clipboardExpand all lines: contrib/pg_stat_statements/pg_stat_statements.c
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,14 +2579,14 @@ JumbleExpr(pgssJumbleState *jstate, Node *node)
25792579
JumbleExpr(jstate, (Node *) expr->aggfilter);
25802580
}
25812581
break;
2582-
case T_ArrayRef:
2582+
case T_SubscriptingRef:
25832583
{
2584-
ArrayRef *aref = (ArrayRef *) node;
2584+
SubscriptingRef *sbsref = (SubscriptingRef *) node;
25852585

2586-
JumbleExpr(jstate, (Node *) aref->refupperindexpr);
2587-
JumbleExpr(jstate, (Node *) aref->reflowerindexpr);
2588-
JumbleExpr(jstate, (Node *) aref->refexpr);
2589-
JumbleExpr(jstate, (Node *) aref->refassgnexpr);
2586+
JumbleExpr(jstate, (Node *) sbsref->refupperindexpr);
2587+
JumbleExpr(jstate, (Node *) sbsref->reflowerindexpr);
2588+
JumbleExpr(jstate, (Node *) sbsref->refexpr);
2589+
JumbleExpr(jstate, (Node *) sbsref->refassgnexpr);
25902590
}
25912591
break;
25922592
case T_FuncExpr:

‎contrib/postgres_fdw/deparse.c

Copy file name to clipboardExpand all lines: contrib/postgres_fdw/deparse.c
+15-15Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static void deparseExpr(Expr *expr, deparse_expr_cxt *context);
149149
static void deparseVar(Var *node, deparse_expr_cxt *context);
150150
static void deparseConst(Const *node, deparse_expr_cxt *context, int showtype);
151151
static void deparseParam(Param *node, deparse_expr_cxt *context);
152-
static void deparseArrayRef(ArrayRef *node, deparse_expr_cxt *context);
152+
static void deparseSubscriptingRef(SubscriptingRef *node, deparse_expr_cxt *context);
153153
static void deparseFuncExpr(FuncExpr *node, deparse_expr_cxt *context);
154154
static void deparseOpExpr(OpExpr *node, deparse_expr_cxt *context);
155155
static void deparseOperatorName(StringInfo buf, Form_pg_operator opform);
@@ -401,34 +401,34 @@ foreign_expr_walker(Node *node,
401401
state = FDW_COLLATE_UNSAFE;
402402
}
403403
break;
404-
case T_ArrayRef:
404+
case T_SubscriptingRef:
405405
{
406-
ArrayRef *ar = (ArrayRef *) node;
406+
SubscriptingRef *sr = (SubscriptingRef *) node;
407407

408408
/* Assignment should not be in restrictions. */
409-
if (ar->refassgnexpr != NULL)
409+
if (sr->refassgnexpr != NULL)
410410
return false;
411411

412412
/*
413-
* Recurse to remaining subexpressions. Since the array
413+
* Recurse to remaining subexpressions. Since the container
414414
* subscripts must yield (noncollatable) integers, they won't
415415
* affect the inner_cxt state.
416416
*/
417-
if (!foreign_expr_walker((Node *) ar->refupperindexpr,
417+
if (!foreign_expr_walker((Node *) sr->refupperindexpr,
418418
glob_cxt, &inner_cxt))
419419
return false;
420-
if (!foreign_expr_walker((Node *) ar->reflowerindexpr,
420+
if (!foreign_expr_walker((Node *) sr->reflowerindexpr,
421421
glob_cxt, &inner_cxt))
422422
return false;
423-
if (!foreign_expr_walker((Node *) ar->refexpr,
423+
if (!foreign_expr_walker((Node *) sr->refexpr,
424424
glob_cxt, &inner_cxt))
425425
return false;
426426

427427
/*
428-
* Array subscripting should yield same collation as input,
429-
* but for safety use same logic as for function nodes.
428+
* Container subscripting should yield same collation as
429+
* input, but for safety use same logic as for function nodes.
430430
*/
431-
collation = ar->refcollid;
431+
collation = sr->refcollid;
432432
if (collation == InvalidOid)
433433
state = FDW_COLLATE_NONE;
434434
else if (inner_cxt.state == FDW_COLLATE_SAFE &&
@@ -2270,8 +2270,8 @@ deparseExpr(Expr *node, deparse_expr_cxt *context)
22702270
case T_Param:
22712271
deparseParam((Param *) node, context);
22722272
break;
2273-
case T_ArrayRef:
2274-
deparseArrayRef((ArrayRef *) node, context);
2273+
case T_SubscriptingRef:
2274+
deparseSubscriptingRef((SubscriptingRef *) node, context);
22752275
break;
22762276
case T_FuncExpr:
22772277
deparseFuncExpr((FuncExpr *) node, context);
@@ -2518,10 +2518,10 @@ deparseParam(Param *node, deparse_expr_cxt *context)
25182518
}
25192519

25202520
/*
2521-
* Deparse an array subscript expression.
2521+
* Deparse a container subscript expression.
25222522
*/
25232523
static void
2524-
deparseArrayRef(ArrayRef *node, deparse_expr_cxt *context)
2524+
deparseSubscriptingRef(SubscriptingRef *node, deparse_expr_cxt *context)
25252525
{
25262526
StringInfo buf = context->buf;
25272527
ListCell *lowlist_item;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.