mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
Fix pg_get_constraintdef to cope with NOT VALID constraints
This case was missed when NOT VALID constraints were first introduced in
commit 722bf7017b
by Simon Riggs on
2011-02-08. Among other things, it causes pg_dump to omit the NOT VALID
flag when dumping such constraints, which may cause them to fail to
load afterwards, if they contained values failing the constraint.
Per report from Thom Brown.
This commit is contained in:
parent
ea8e42f3a0
commit
048417511a
@ -1373,6 +1373,9 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
|
||||
if (conForm->condeferred)
|
||||
appendStringInfo(&buf, " INITIALLY DEFERRED");
|
||||
|
||||
if (!conForm->convalidated)
|
||||
appendStringInfoString(&buf, " NOT VALID");
|
||||
|
||||
/* Cleanup */
|
||||
ReleaseSysCache(tup);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user