From d988d92bf0603cdf07a57f57f53a28caf5e951f5 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 15 Jun 2011 19:05:11 -0400 Subject: Rework parsing of ConstraintAttributeSpec to improve NOT VALID handling. The initial commit of the ALTER TABLE ADD FOREIGN KEY NOT VALID feature failed to support labeling such constraints as deferrable. The best fix for this seems to be to fold NOT VALID into ConstraintAttributeSpec. That's a bit more general than the documented syntax, but it allows better-targeted syntax error messages. In addition, do some mostly-but-not-entirely-cosmetic code review for the whole NOT VALID patch. --- src/backend/commands/trigger.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/backend/commands/trigger.c') diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index ce36ea8be45..798d8a85a4f 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -1006,6 +1006,8 @@ ConvertTriggerToFK(CreateTrigStmt *stmt, Oid funcoid) } fkcon->deferrable = stmt->deferrable; fkcon->initdeferred = stmt->initdeferred; + fkcon->skip_validation = false; + fkcon->initially_valid = true; /* ... and execute it */ ProcessUtility((Node *) atstmt, -- cgit v1.2.3