diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-06-15 19:05:11 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-06-15 19:06:21 -0400 |
commit | e1ccaff6eea1b48f4b9b28cabaf0f990119b0d19 (patch) | |
tree | a0a27055b145ea815d4658120bf120d8dbe91414 /src/backend/parser/parse_utilcmd.c | |
parent | e3df3572f66aa099d337f013dceef7d519ef8398 (diff) | |
download | postgresql-e1ccaff6eea1b48f4b9b28cabaf0f990119b0d19.tar.gz postgresql-e1ccaff6eea1b48f4b9b28cabaf0f990119b0d19.zip |
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.
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
-rw-r--r-- | src/backend/parser/parse_utilcmd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 485bf4b8e7f..51899c6b5b4 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -1751,7 +1751,8 @@ transformFKConstraints(CreateStmtContext *cxt, /* * If CREATE TABLE or adding a column with NULL default, we can safely - * skip validation of the constraint. + * skip validation of FK constraints, and nonetheless mark them valid. + * (This will override any user-supplied NOT VALID flag.) */ if (skipValidation) { |