mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
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
This commit is contained in:
@ -149,7 +149,7 @@ static void deparseExpr(Expr *expr, deparse_expr_cxt *context);
|
||||
static void deparseVar(Var *node, deparse_expr_cxt *context);
|
||||
static void deparseConst(Const *node, deparse_expr_cxt *context, int showtype);
|
||||
static void deparseParam(Param *node, deparse_expr_cxt *context);
|
||||
static void deparseArrayRef(ArrayRef *node, deparse_expr_cxt *context);
|
||||
static void deparseSubscriptingRef(SubscriptingRef *node, deparse_expr_cxt *context);
|
||||
static void deparseFuncExpr(FuncExpr *node, deparse_expr_cxt *context);
|
||||
static void deparseOpExpr(OpExpr *node, deparse_expr_cxt *context);
|
||||
static void deparseOperatorName(StringInfo buf, Form_pg_operator opform);
|
||||
@ -401,34 +401,34 @@ foreign_expr_walker(Node *node,
|
||||
state = FDW_COLLATE_UNSAFE;
|
||||
}
|
||||
break;
|
||||
case T_ArrayRef:
|
||||
case T_SubscriptingRef:
|
||||
{
|
||||
ArrayRef *ar = (ArrayRef *) node;
|
||||
SubscriptingRef *sr = (SubscriptingRef *) node;
|
||||
|
||||
/* Assignment should not be in restrictions. */
|
||||
if (ar->refassgnexpr != NULL)
|
||||
if (sr->refassgnexpr != NULL)
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Recurse to remaining subexpressions. Since the array
|
||||
* Recurse to remaining subexpressions. Since the container
|
||||
* subscripts must yield (noncollatable) integers, they won't
|
||||
* affect the inner_cxt state.
|
||||
*/
|
||||
if (!foreign_expr_walker((Node *) ar->refupperindexpr,
|
||||
if (!foreign_expr_walker((Node *) sr->refupperindexpr,
|
||||
glob_cxt, &inner_cxt))
|
||||
return false;
|
||||
if (!foreign_expr_walker((Node *) ar->reflowerindexpr,
|
||||
if (!foreign_expr_walker((Node *) sr->reflowerindexpr,
|
||||
glob_cxt, &inner_cxt))
|
||||
return false;
|
||||
if (!foreign_expr_walker((Node *) ar->refexpr,
|
||||
if (!foreign_expr_walker((Node *) sr->refexpr,
|
||||
glob_cxt, &inner_cxt))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Array subscripting should yield same collation as input,
|
||||
* but for safety use same logic as for function nodes.
|
||||
* Container subscripting should yield same collation as
|
||||
* input, but for safety use same logic as for function nodes.
|
||||
*/
|
||||
collation = ar->refcollid;
|
||||
collation = sr->refcollid;
|
||||
if (collation == InvalidOid)
|
||||
state = FDW_COLLATE_NONE;
|
||||
else if (inner_cxt.state == FDW_COLLATE_SAFE &&
|
||||
@ -2270,8 +2270,8 @@ deparseExpr(Expr *node, deparse_expr_cxt *context)
|
||||
case T_Param:
|
||||
deparseParam((Param *) node, context);
|
||||
break;
|
||||
case T_ArrayRef:
|
||||
deparseArrayRef((ArrayRef *) node, context);
|
||||
case T_SubscriptingRef:
|
||||
deparseSubscriptingRef((SubscriptingRef *) node, context);
|
||||
break;
|
||||
case T_FuncExpr:
|
||||
deparseFuncExpr((FuncExpr *) node, context);
|
||||
@ -2518,10 +2518,10 @@ deparseParam(Param *node, deparse_expr_cxt *context)
|
||||
}
|
||||
|
||||
/*
|
||||
* Deparse an array subscript expression.
|
||||
* Deparse a container subscript expression.
|
||||
*/
|
||||
static void
|
||||
deparseArrayRef(ArrayRef *node, deparse_expr_cxt *context)
|
||||
deparseSubscriptingRef(SubscriptingRef *node, deparse_expr_cxt *context)
|
||||
{
|
||||
StringInfo buf = context->buf;
|
||||
ListCell *lowlist_item;
|
||||
|
Reference in New Issue
Block a user