aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-05-28 15:40:36 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-05-28 15:40:36 +0000
commitb81737bfa87f480cb309b86a5973dc71f48d2ff9 (patch)
treeb4e4d4da665e081cbbbd42125ee82b4607aa0294
parentefe861c85589dfde53a4aa3a5d067a78e2a0b87b (diff)
downloadpostgresql-b81737bfa87f480cb309b86a5973dc71f48d2ff9.tar.gz
postgresql-b81737bfa87f480cb309b86a5973dc71f48d2ff9.zip
Repair incorrect dumping of user-defined aggregate with null initcond.
(Already fixed in current, but need a patch for 7.2.2.)
-rw-r--r--src/bin/pg_dump/pg_dump.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index f6e67719f08..1d20a3decea 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.241.2.1 2002/05/14 02:08:22 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.241.2.2 2002/05/28 15:40:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1910,7 +1910,10 @@ getAggregates(int *numAggs)
agginfo[i].aggfinalfn = strdup(PQgetvalue(res, i, i_aggfinalfn));
agginfo[i].aggtranstype = strdup(PQgetvalue(res, i, i_aggtranstype));
agginfo[i].aggbasetype = strdup(PQgetvalue(res, i, i_aggbasetype));
- agginfo[i].agginitval = strdup(PQgetvalue(res, i, i_agginitval));
+ if (PQgetisnull(res, i, i_agginitval))
+ agginfo[i].agginitval = NULL;
+ else
+ agginfo[i].agginitval = strdup(PQgetvalue(res, i, i_agginitval));
agginfo[i].usename = strdup(PQgetvalue(res, i, i_usename));
if (strlen(agginfo[i].usename) == 0)
write_msg(NULL, "WARNING: owner of aggregate function \"%s\" appears to be invalid\n",