diff options
author | Simon Riggs <simon@2ndQuadrant.com> | 2011-02-08 12:23:20 +0000 |
---|---|---|
committer | Simon Riggs <simon@2ndQuadrant.com> | 2011-02-08 12:23:20 +0000 |
commit | 722bf7017bbe796decc79c1fde03e7a83dae9ada (patch) | |
tree | 94145fc7a78c140f753d856bae8edf54bcce93b3 /src/include/nodes/parsenodes.h | |
parent | 7202ad7b8dd07864092be70287fe971ec72a3fbc (diff) |
Extend ALTER TABLE to allow Foreign Keys to be added without initial validation.
FK constraints that are marked NOT VALID may later be VALIDATED, which uses an
ShareUpdateExclusiveLock on constraint table and RowShareLock on referenced
table. Significantly reduces lock strength and duration when adding FKs.
New state visible from psql.
Simon Riggs, with reviews from Marko Tiikkaja and Robert Haas
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r-- | src/include/nodes/parsenodes.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index d7d1b0a6fdf..978e7b79212 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1140,6 +1140,7 @@ typedef enum AlterTableType AT_ReAddIndex, /* internal to commands/tablecmds.c */ AT_AddConstraint, /* add constraint */ AT_AddConstraintRecurse, /* internal to commands/tablecmds.c */ + AT_ValidateConstraint, /* validate constraint */ AT_ProcessedConstraint, /* pre-processed add constraint (local in * parser/parse_utilcmd.c) */ AT_AddIndexConstraint, /* add constraint using existing index */ @@ -1182,6 +1183,7 @@ typedef struct AlterTableCmd /* one subcommand of an ALTER TABLE */ Node *transform; /* transformation expr for ALTER TYPE */ DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */ bool missing_ok; /* skip error if missing? */ + bool validated; } AlterTableCmd; |