mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Improve ALTER DOMAIN / DROP CONSTRAINT with nonexistent constraint
ALTER DOMAIN / DROP CONSTRAINT on a nonexistent constraint name did not report any error. Now it reports an error. The IF EXISTS option was added to get the usual behavior of ignoring nonexistent objects to drop.
This commit is contained in:
@ -7616,6 +7616,18 @@ AlterDomainStmt:
|
||||
n->typeName = $3;
|
||||
n->name = $6;
|
||||
n->behavior = $7;
|
||||
n->missing_ok = false;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
/* ALTER DOMAIN <domain> DROP CONSTRAINT IF EXISTS <name> [RESTRICT|CASCADE] */
|
||||
| ALTER DOMAIN_P any_name DROP CONSTRAINT IF_P EXISTS name opt_drop_behavior
|
||||
{
|
||||
AlterDomainStmt *n = makeNode(AlterDomainStmt);
|
||||
n->subtype = 'X';
|
||||
n->typeName = $3;
|
||||
n->name = $8;
|
||||
n->behavior = $9;
|
||||
n->missing_ok = true;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
/* ALTER DOMAIN <domain> VALIDATE CONSTRAINT <name> */
|
||||
|
Reference in New Issue
Block a user