Skip to content

Commit 0484175

Browse files
committed
Fix pg_get_constraintdef to cope with NOT VALID constraints
This case was missed when NOT VALID constraints were first introduced in commit 722bf70 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.
1 parent ea8e42f commit 0484175

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/backend/utils/adt/ruleutils.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,9 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
13731373
if (conForm->condeferred)
13741374
appendStringInfo(&buf, " INITIALLY DEFERRED");
13751375

1376+
if (!conForm->convalidated)
1377+
appendStringInfoString(&buf, " NOT VALID");
1378+
13761379
/* Cleanup */
13771380
ReleaseSysCache(tup);
13781381

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy