diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-05-15 15:06:53 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-05-15 15:06:53 -0400 |
commit | 05ca21b878a9e483a4635ba4b23e0f45d5442fc3 (patch) | |
tree | 09a53a4f147653d1a5c48f3937e0eaba4a9871eb /src/backend/executor/nodeAgg.c | |
parent | 185f4f84d5952e5692bd2712dd32288fcbb7fa71 (diff) | |
download | postgresql-05ca21b878a9e483a4635ba4b23e0f45d5442fc3.tar.gz postgresql-05ca21b878a9e483a4635ba4b23e0f45d5442fc3.zip |
Fix type checking for support functions of parallel VARIADIC aggregates.
The impact of VARIADIC on the combine/serialize/deserialize support
functions of an aggregate wasn't thought through carefully. There is
actually no impact, because variadicity isn't passed through to these
functions (and it doesn't seem like it would need to be). However,
lookup_agg_function was mistakenly told to check things as though it were
passed through. The net result was that it was impossible to declare an
aggregate that had both VARIADIC input and parallelism support functions.
In passing, fix a runtime check in nodeAgg.c for the combine function's
strictness to make its error message agree with the creation-time check.
The previous message was actually backwards, and it doesn't seem like
there's a good reason to have two versions of this message text anyway.
Back-patch to 9.6 where parallel aggregation was introduced.
Alexey Bashtanov; message fix by me
Discussion: https://postgr.es/m/f86dde87-fef4-71eb-0480-62754aaca01b@imap.cc
Diffstat (limited to 'src/backend/executor/nodeAgg.c')
-rw-r--r-- | src/backend/executor/nodeAgg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 7624a3ac6ef..a27c292d4c9 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -2940,8 +2940,8 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans, if (pertrans->transfn.fn_strict && aggtranstype == INTERNALOID) ereport(ERROR, (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), - errmsg("combine function for aggregate %u must be declared as STRICT", - aggref->aggfnoid))); + errmsg("combine function with transition type %s must not be declared STRICT", + format_type_be(aggtranstype)))); } else { |