Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1489e2f

Browse files
committed
Improve behavior of concurrent ALTER TABLE, and do some refactoring.
ALTER TABLE (and ALTER VIEW, ALTER SEQUENCE, etc.) now use a RangeVarGetRelid callback to check permissions before acquiring a table lock. We also now use the same callback for all forms of ALTER TABLE, rather than having separate, almost-identical callbacks for ALTER TABLE .. SET SCHEMA and ALTER TABLE .. RENAME, and no callback at all for everything else. I went ahead and changed the code so that no form of ALTER TABLE works on foreign tables; you must use ALTER FOREIGN TABLE instead. In 9.1, it was possible to use ALTER TABLE .. SET SCHEMA or ALTER TABLE .. RENAME on a foreign table, but not any other form of ALTER TABLE, which did not seem terribly useful or consistent. Patch by me; review by Noah Misch.
1 parent 33aaa13 commit 1489e2f

File tree

4 files changed

+170
-254
lines changed

4 files changed

+170
-254
lines changed

src/backend/commands/alter.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt)
192192
case OBJECT_TABLE:
193193
case OBJECT_VIEW:
194194
case OBJECT_FOREIGN_TABLE:
195-
AlterTableNamespace(stmt->relation, stmt->newschema,
196-
stmt->objectType, AccessExclusiveLock);
195+
AlterTableNamespace(stmt);
197196
break;
198197

199198
case OBJECT_TSPARSER:

0 commit comments

Comments
 (0)