mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
ALTER TABLE ... ALTER CONSTRAINT for FKs
Allow constraint attributes to be altered, so the default setting of NOT DEFERRABLE can be altered to DEFERRABLE and back. Review by Abhijit Menon-Sen
This commit is contained in:
@ -1941,6 +1941,21 @@ alter_table_cmd:
|
||||
n->def = $2;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
/* ALTER TABLE <name> ALTER CONSTRAINT ... */
|
||||
| ALTER CONSTRAINT name ConstraintAttributeSpec
|
||||
{
|
||||
AlterTableCmd *n = makeNode(AlterTableCmd);
|
||||
Constraint *c = makeNode(Constraint);
|
||||
n->subtype = AT_AlterConstraint;
|
||||
n->def = (Node *) c;
|
||||
c->contype = CONSTR_FOREIGN; /* others not supported, yet */
|
||||
c->conname = $3;
|
||||
processCASbits($4, @4, "ALTER CONSTRAINT statement",
|
||||
&c->deferrable,
|
||||
&c->initdeferred,
|
||||
NULL, NULL, yyscanner);
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
/* ALTER TABLE <name> VALIDATE CONSTRAINT ... */
|
||||
| VALIDATE CONSTRAINT name
|
||||
{
|
||||
|
Reference in New Issue
Block a user