diff options
Diffstat (limited to 'src/bin/pg_dump/pg_dump.c')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 2fec7326d50..eef9a4c875a 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -12,7 +12,7 @@ * by PostgreSQL * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.459 2007/01/25 03:30:43 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.460 2007/02/14 01:58:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -3841,7 +3841,7 @@ getTriggers(TableInfo tblinfo[], int numTables) selectSourceSchema(tbinfo->dobj.namespace->dobj.name); resetPQExpBuffer(query); - if (g_fout->remoteVersion >= 70300) + if (g_fout->remoteVersion >= 80300) { /* * We ignore triggers that are tied to a foreign-key constraint @@ -3855,6 +3855,25 @@ getTriggers(TableInfo tblinfo[], int numTables) "tgconstrrelid::pg_catalog.regclass as tgconstrrelname " "from pg_catalog.pg_trigger t " "where tgrelid = '%u'::pg_catalog.oid " + "and tgconstraint = 0", + tbinfo->dobj.catId.oid); + } + else if (g_fout->remoteVersion >= 70300) + { + /* + * We ignore triggers that are tied to a foreign-key constraint, + * but in these versions we have to grovel through pg_constraint + * to find out + */ + appendPQExpBuffer(query, + "SELECT tgname, " + "tgfoid::pg_catalog.regproc as tgfname, " + "tgtype, tgnargs, tgargs, tgenabled, " + "tgisconstraint, tgconstrname, tgdeferrable, " + "tgconstrrelid, tginitdeferred, tableoid, oid, " + "tgconstrrelid::pg_catalog.regclass as tgconstrrelname " + "from pg_catalog.pg_trigger t " + "where tgrelid = '%u'::pg_catalog.oid " "and (not tgisconstraint " " OR NOT EXISTS" " (SELECT 1 FROM pg_catalog.pg_depend d " |