diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-02-01 12:50:32 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-02-01 12:50:32 -0300 |
commit | 558d77f20e4e9ed18101d5d057b770ae22ece855 (patch) | |
tree | c65b6dff674f7f6a46a391683e281a51839162c1 /contrib/postgres_fdw | |
parent | f831d4accda00b9144bc647ede2e2f848b59f39d (diff) | |
download | postgresql-558d77f20e4e9ed18101d5d057b770ae22ece855.tar.gz |
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
Diffstat (limited to 'contrib/postgres_fdw')
-rw-r--r-- | contrib/postgres_fdw/deparse.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c index b0e44e5562..92a0ab6da5 100644 --- a/contrib/postgres_fdw/deparse.c +++ b/contrib/postgres_fdw/deparse.c @@ -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; |