From: Tom Lane Date: Mon, 22 Oct 2001 19:31:09 +0000 (+0000) Subject: Generate correct syntax for DROP OPERATOR with unary operators. X-Git-Tag: REL9_0_0~19319 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b2e859a4feb94623ee1c3bade5e937a80bc9893e;p=pg-rex%2Fsyncrep.git Generate correct syntax for DROP OPERATOR with unary operators. --- diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c index f1ba9aed4b..b04b3d8eb7 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.58 2001/10/03 20:54:21 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.59 2001/10/22 19:31:09 tgl Exp $ * * Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2 * @@ -74,6 +74,8 @@ findTypeByOid(TypeInfo *tinfo, int numTypes, const char *oid, OidOptions opts) return "'any'"; else if ((opts & zeroAsStar) != 0) return "*"; + else if ((opts & zeroAsNone) != 0) + return "NONE"; } for (i = 0; i < numTypes; i++) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 8da63e6e65..ce97db498f 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.233 2001/10/03 20:54:21 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.234 2001/10/22 19:31:09 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -3642,10 +3642,13 @@ dumpOprs(Archive *fout, OprInfo *oprinfo, int numOperators, } resetPQExpBuffer(delq); - appendPQExpBuffer(delq, "DROP OPERATOR %s (%s", oprinfo[i].oprname, - findTypeByOid(tinfo, numTypes, oprinfo[i].oprleft, zeroAsOpaque)); + appendPQExpBuffer(delq, "DROP OPERATOR %s (%s", + oprinfo[i].oprname, + findTypeByOid(tinfo, numTypes, oprinfo[i].oprleft, + zeroAsNone)); appendPQExpBuffer(delq, ", %s);\n", - findTypeByOid(tinfo, numTypes, oprinfo[i].oprright, zeroAsOpaque)); + findTypeByOid(tinfo, numTypes, oprinfo[i].oprright, + zeroAsNone)); resetPQExpBuffer(q); appendPQExpBuffer(q, diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index 1282045895..dbd7f598d7 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_dump.h,v 1.72 2001/10/03 20:54:21 tgl Exp $ + * $Id: pg_dump.h,v 1.73 2001/10/22 19:31:09 tgl Exp $ * * Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2 * @@ -224,6 +224,7 @@ typedef enum _OidOptions zeroAsOpaque = 1, zeroAsAny = 2, zeroAsStar = 4, + zeroAsNone = 8, useBaseTypeName = 1024 } OidOptions;