mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Improve behavior of concurrent ALTER <relation> .. SET SCHEMA.
If the referrent of a name changes while we're waiting for the lock, we must recheck permissons. We also now check the relkind before locking, since it's easy to do that long the way. Patch by me; review by Noah Misch.
This commit is contained in:
@ -191,7 +191,6 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt)
|
||||
case OBJECT_TABLE:
|
||||
case OBJECT_VIEW:
|
||||
case OBJECT_FOREIGN_TABLE:
|
||||
CheckRelationOwnership(stmt->relation, true);
|
||||
AlterTableNamespace(stmt->relation, stmt->newschema,
|
||||
stmt->objectType, AccessExclusiveLock);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user