From: Bruce Momjian Date: Wed, 8 Jan 2003 22:54:36 +0000 (+0000) Subject: Fix dumping of DEFERRABLE/INITIALLY DEFERRED: X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=524333e8aa3438af16b64cd12d6fc913e3d235df;p=users%2Fbernd%2Fpostgres.git Fix dumping of DEFERRABLE/INITIALLY DEFERRED: > The big problem is that while pg_dump's dump_trigger() looks at > tginitdeferred and dumps accordingly, pg_get_constraintdef doesn't look > at tginitdeferred, and therefore doesn't record the requirement as part > of ALTER TABLE ADD CONSTRAINT. pg_get_constraintdef should probably be looking at condeferrable and condeferred in the pg_constraint row it's looking at. Maybe something like the attached. (Added, output only non-default values.) Stephan Szabo --- diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index f2c9413a0e..7a6f7a0bc2 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -688,6 +688,11 @@ pg_get_constraintdef(PG_FUNCTION_ARGS) } appendStringInfo(&buf, " ON DELETE %s", string); + if (conForm->condeferrable) + appendStringInfo(&buf, " DEFERRABLE"); + if (conForm->condeferred) + appendStringInfo(&buf, " INITIALLY DEFERRED"); + break; }