postgresql/src/bin/pg_dump
Tom Lane f0fedfe82c Allow polymorphic aggregates to have non-polymorphic state data types.
Before 9.4, such an aggregate couldn't be declared, because its final
function would have to have polymorphic result type but no polymorphic
argument, which CREATE FUNCTION would quite properly reject.  The
ordered-set-aggregate patch found a workaround: allow the final function
to be declared as accepting additional dummy arguments that have types
matching the aggregate's regular input arguments.  However, we failed
to notice that this problem applies just as much to regular aggregates,
despite the fact that we had a built-in regular aggregate array_agg()
that was known to be undeclarable in SQL because its final function
had an illegal signature.  So what we should have done, and what this
patch does, is to decouple the extra-dummy-arguments behavior from
ordered-set aggregates and make it generally available for all aggregate
declarations.  We have to put this into 9.4 rather than waiting till
later because it slightly alters the rules for declaring ordered-set
aggregates.

The patch turned out a bit bigger than I'd hoped because it proved
necessary to record the extra-arguments option in a new pg_aggregate
column.  I'd thought we could just look at the final function's pronargs
at runtime, but that didn't work well for variadic final functions.
It's probably just as well though, because it simplifies life for pg_dump
to record the option explicitly.

While at it, fix array_agg() to have a valid final-function signature,
and add an opr_sanity test to notice future deviations from polymorphic
consistency.  I also marked the percentile_cont() aggregates as not
needing extra arguments, since they don't.
2014-04-23 19:17:41 -04:00
..
po Translation updates 2013-12-02 00:17:07 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
common.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
compress_io.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
compress_io.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
dumputils.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
dumputils.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
keywords.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
Makefile Update copyright for 2014 2014-01-07 16:05:30 -05:00
nls.mk Switch dependency order of libpgcommon and libpgport 2013-10-17 22:02:35 -04:00
parallel.c Use AF_UNSPEC not PF_UNSPEC in getaddrinfo calls. 2014-04-16 13:21:20 -04:00
parallel.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pg_backup.h pg_dump et al: Add --if-exists option 2014-03-03 15:02:18 -03:00
pg_backup_archiver.c pg_dump et al: Add --if-exists option 2014-03-03 15:02:18 -03:00
pg_backup_archiver.h pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
pg_backup_custom.c Focus on ftello result < 0 instead of errno 2014-02-09 13:29:36 -05:00
pg_backup_db.c Move some pg_dump function around. 2013-03-27 18:10:40 +02:00
pg_backup_db.h pg_dump: Further reduce reliance on global variables. 2012-02-07 10:07:02 -05:00
pg_backup_directory.c Remove MinGW readdir/errno bug workaround fixed on 2003-10-10 2014-03-21 13:47:37 -04:00
pg_backup_null.c Move some pg_dump function around. 2013-03-27 18:10:40 +02:00
pg_backup_tar.c Further pg_dump / ftello improvements 2014-02-09 18:28:14 -05:00
pg_backup_tar.h Fix tar files emitted by pg_dump and pg_basebackup to be POSIX conformant. 2012-09-28 15:19:15 -04:00
pg_backup_utils.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
pg_backup_utils.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pg_dump.c Allow polymorphic aggregates to have non-polymorphic state data types. 2014-04-23 19:17:41 -04:00
pg_dump.h Fix dumping of a materialized view that depends on a table's primary key. 2014-03-29 17:34:00 -04:00
pg_dump_sort.c Fix dumping of a materialized view that depends on a table's primary key. 2014-03-29 17:34:00 -04:00
pg_dumpall.c Fix pg_dumpall option parsing: -i doesn't take an argument. 2014-03-18 10:38:25 -04:00
pg_restore.c pg_dump et al: Add --if-exists option 2014-03-03 15:02:18 -03:00