mirror of
https://github.com/postgres/postgres.git
synced 2025-06-17 17:02:08 +03:00
Add support for ALTER TABLE IF EXISTS ... RENAME CONSTRAINT
Also add regression test. Previously this was documented to work, but didn't.
This commit is contained in:
@ -2497,9 +2497,16 @@ RenameConstraint(RenameStmt *stmt)
|
||||
{
|
||||
/* lock level taken here should match rename_constraint_internal */
|
||||
relid = RangeVarGetRelidExtended(stmt->relation, AccessExclusiveLock,
|
||||
false, false,
|
||||
stmt->missing_ok, false,
|
||||
RangeVarCallbackForRenameAttribute,
|
||||
NULL);
|
||||
if (!OidIsValid(relid))
|
||||
{
|
||||
ereport(NOTICE,
|
||||
(errmsg("relation \"%s\" does not exist, skipping",
|
||||
stmt->relation->relname)));
|
||||
return InvalidObjectAddress;
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
|
Reference in New Issue
Block a user