From: Tom Lane Date: Tue, 28 May 2002 15:40:36 +0000 (+0000) Subject: Repair incorrect dumping of user-defined aggregate with null initcond. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=1b661456cf95dfe75c90aad8de75a55cf532d650;p=users%2Fbernd%2Fpostgres.git Repair incorrect dumping of user-defined aggregate with null initcond. (Already fixed in current, but need a patch for 7.2.2.) --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index e75d667aae..84d122a27d 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -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",