pgsql: Fix type checking for support functions of parallel VARIADIC agg

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix type checking for support functions of parallel VARIADIC agg
Date: 2018-05-15 19:07:05
Message-ID: E1fIfHt-0002X9-1r@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/17083ab7e121d99c346bebfc979eb83ffe9c41ce

Modified Files
--------------
src/backend/catalog/pg_aggregate.c | 27 +++++++++++++++++----------
src/backend/executor/nodeAgg.c | 4 ++--
2 files changed, 19 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2018-05-15 19:56:02 pgsql: docs: update PG 11 release notes based on feedback
Previous Message Bruce Momjian 2018-05-15 00:45:44 pgsql: doc: clarify SCRAM channel binding