pgsql: Make CREATE AGGREGATE complain if the initcond is invalid for th

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make CREATE AGGREGATE complain if the initcond is invalid for th
Date: 2012-10-04 21:55:02
Message-ID: E1TJtNm-0004pr-92@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make CREATE AGGREGATE complain if the initcond is invalid for the datatype.

The initial transition value is stored as a text string and not fed to the
transition type's input function until runtime (so that values such as
"now" don't get frozen at creation time). Previously, CREATE AGGREGATE
didn't do anything with it but that, which meant that even erroneous values
would be accepted and not complained of until the aggregate is used. This
seems unhelpful, and it's confused at least one user, as in Rhys Stewart's
recent report. It seems worth taking a few more cycles to invoke the input
function and verify that the value is acceptable. We can't do this if the
transition type is polymorphic, but in normal aggregates we know the actual
transition type so we can call the right input function.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e1e60694b4a69786dc5ff27e340afeaad7833eb9

Modified Files
--------------
src/backend/commands/aggregatecmds.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2012-10-05 01:49:51 pgsql: Remove redundant code for getnameinfo() replacement
Previous Message Tom Lane 2012-10-04 21:15:48 pgsql: Fix parse location tracking for lists that can be empty.