summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_agg.c
diff options
context:
space:
mode:
authorTom Lane2018-02-10 18:05:14 +0000
committerTom Lane2018-02-10 18:05:14 +0000
commit65b1d767856d96c7d6f952f30890dd5b7d4b66bb (patch)
tree81f43c2ee257f223e7d9f7f8943ac5274e24bb16 /src/backend/parser/parse_agg.c
parentfad15f4a547ad433a28c370bd071b08df9e65f10 (diff)
Fix oversight in CALL argument handling, and do some minor cleanup.
CALL statements cannot support sub-SELECTs in the arguments of the called procedure, since they just use ExecEvalExpr to evaluate such arguments. Teach transformSubLink() to reject the case, as it already does for other contexts in which subqueries are not supported. In passing, s/EXPR_KIND_CALL/EXPR_KIND_CALL_ARGUMENT/ to make that enum symbol line up more closely with the phrasing of the error messages it is associated with. And fix someone's weak grasp of English grammar in the preceding EXPR_KIND_PARTITION_EXPRESSION addition. Also update an incorrect comment in resolve_unique_index_expr (possibly it was correct when written, but nowadays transformExpr definitely does reject SRFs here). Per report from Pavel Stehule --- but this resolves only one of the bugs he mentions. Discussion: https://postgr.es/m/CAFj8pRDxOwPPzpA8i+AQeDQFj7bhVw-dR2==rfWZ3zMGkm568Q@mail.gmail.com
Diffstat (limited to 'src/backend/parser/parse_agg.c')
-rw-r--r--src/backend/parser/parse_agg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c
index 747139489a0..377a7ed6d0a 100644
--- a/src/backend/parser/parse_agg.c
+++ b/src/backend/parser/parse_agg.c
@@ -509,13 +509,13 @@ check_agglevels_and_constraints(ParseState *pstate, Node *expr)
break;
case EXPR_KIND_PARTITION_EXPRESSION:
if (isAgg)
- err = _("aggregate functions are not allowed in partition key expression");
+ err = _("aggregate functions are not allowed in partition key expressions");
else
- err = _("grouping operations are not allowed in partition key expression");
+ err = _("grouping operations are not allowed in partition key expressions");
break;
- case EXPR_KIND_CALL:
+ case EXPR_KIND_CALL_ARGUMENT:
if (isAgg)
err = _("aggregate functions are not allowed in CALL arguments");
else
@@ -897,9 +897,9 @@ transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc,
err = _("window functions are not allowed in trigger WHEN conditions");
break;
case EXPR_KIND_PARTITION_EXPRESSION:
- err = _("window functions are not allowed in partition key expression");
+ err = _("window functions are not allowed in partition key expressions");
break;
- case EXPR_KIND_CALL:
+ case EXPR_KIND_CALL_ARGUMENT:
err = _("window functions are not allowed in CALL arguments");
break;