mirror of
https://github.com/postgres/postgres.git
synced 2025-12-06 00:02:13 +03:00
Revert "Accept relations of any kind in LOCK TABLE".
Revert59ab4ac32, as well as the followup fix33862cb9c, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take another crack at this later. Discussion: https://postgr.es/m/16703-e348f58aab3cf6cc@postgresql.org
This commit is contained in:
@@ -88,6 +88,13 @@ RangeVarCallbackForLockTable(const RangeVar *rv, Oid relid, Oid oldrelid,
|
||||
return; /* woops, concurrently dropped; no permissions
|
||||
* check */
|
||||
|
||||
/* Currently, we only allow plain tables to be locked */
|
||||
if (relkind != RELKIND_RELATION && relkind != RELKIND_PARTITIONED_TABLE)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
|
||||
errmsg("\"%s\" is not a table",
|
||||
rv->relname)));
|
||||
|
||||
/*
|
||||
* Make note if a temporary relation has been accessed in this
|
||||
* transaction.
|
||||
|
||||
Reference in New Issue
Block a user