1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

DROP AGGREGATE and COMMENT ON AGGREGATE now accept the expected syntax

'aggname (aggtype)'.  The old syntax 'aggname aggtype' is still accepted
for backwards compatibility.  Fix pg_dump, which was actually broken for
most cases of user-defined aggregates.  Clean up error messages associated
with these commands.
This commit is contained in:
Tom Lane
2001-10-03 20:54:22 +00:00
parent 16def00ffb
commit 2e5fda7b7e
14 changed files with 137 additions and 157 deletions

View File

@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.232 2001/10/03 05:23:12 thomas Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.233 2001/10/03 20:54:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3706,7 +3706,9 @@ dumpAggs(Archive *fout, AggInfo *agginfo, int numAggs,
resetPQExpBuffer(aggSig);
appendPQExpBuffer(aggSig, "%s(%s)", agginfo[i].aggname,
findTypeByOid(tinfo, numTypes, agginfo[i].aggbasetype, zeroAsOpaque + useBaseTypeName));
findTypeByOid(tinfo, numTypes,
agginfo[i].aggbasetype,
zeroAsStar + useBaseTypeName));
if (!agginfo[i].convertok)
{
@@ -3721,7 +3723,8 @@ dumpAggs(Archive *fout, AggInfo *agginfo, int numAggs,
continue;
}
name = findTypeByOid(tinfo, numTypes, agginfo[i].aggbasetype, zeroAsAny + useBaseTypeName);
name = findTypeByOid(tinfo, numTypes, agginfo[i].aggbasetype,
zeroAsAny + useBaseTypeName);
if (name == NULL)
{
write_msg(NULL, "WARNING: aggregate function \"%s\" (oid %s) not dumped\n",
@@ -3738,7 +3741,8 @@ dumpAggs(Archive *fout, AggInfo *agginfo, int numAggs,
}
appendPQExpBuffer(details, "BASETYPE = %s, ", name);
name = findTypeByOid(tinfo, numTypes, agginfo[i].aggtranstype, zeroAsOpaque + useBaseTypeName);
name = findTypeByOid(tinfo, numTypes, agginfo[i].aggtranstype,
zeroAsOpaque + useBaseTypeName);
if (name == NULL)
{
write_msg(NULL, "WARNING: aggregate function \"%s\" (oid %s) not dumped\n",
@@ -3781,8 +3785,7 @@ dumpAggs(Archive *fout, AggInfo *agginfo, int numAggs,
/*** Dump Aggregate Comments ***/
resetPQExpBuffer(q);
appendPQExpBuffer(q, "AGGREGATE %s %s", agginfo[i].aggname,
findTypeByOid(tinfo, numTypes, agginfo[i].aggbasetype, zeroAsOpaque + useBaseTypeName));
appendPQExpBuffer(q, "AGGREGATE %s", aggSig->data);
dumpComment(fout, q->data, agginfo[i].oid, "pg_aggregate", 0, NULL);
}