> 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
* back to source text
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.124 2002/09/19 23:40:56 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.124.2.1 2003/01/08 22:54:36 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
}
appendStringInfo(&buf, " ON DELETE %s", string);
+ if (conForm->condeferrable)
+ appendStringInfo(&buf, " DEFERRABLE");
+ if (conForm->condeferred)
+ appendStringInfo(&buf, " INITIALLY DEFERRED");
+
break;
}