mirror of
https://github.com/postgres/postgres.git
synced 2025-10-18 04:29:09 +03:00
Add support for renaming domain constraints
This commit is contained in:
@@ -6529,6 +6529,16 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
|
||||
n->missing_ok = false;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| ALTER DOMAIN_P any_name RENAME CONSTRAINT name TO name
|
||||
{
|
||||
RenameStmt *n = makeNode(RenameStmt);
|
||||
n->renameType = OBJECT_CONSTRAINT;
|
||||
n->relationType = OBJECT_DOMAIN;
|
||||
n->object = $3;
|
||||
n->subname = $6;
|
||||
n->newname = $8;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| ALTER FOREIGN DATA_P WRAPPER name RENAME TO name
|
||||
{
|
||||
RenameStmt *n = makeNode(RenameStmt);
|
||||
|
@@ -802,7 +802,7 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
|
||||
|
||||
/* Copy comment on constraint */
|
||||
if ((table_like_clause->options & CREATE_TABLE_LIKE_COMMENTS) &&
|
||||
(comment = GetComment(get_constraint_oid(RelationGetRelid(relation),
|
||||
(comment = GetComment(get_relation_constraint_oid(RelationGetRelid(relation),
|
||||
n->conname, false),
|
||||
ConstraintRelationId,
|
||||
0)) != NULL)
|
||||
|
Reference in New Issue
Block a user