Simplify permissions for LOCK TABLE.
Jeff Davis <jdavis@postgresql.org>
Simplify permissions for LOCK TABLE. The prior behavior was confusing and hard to document. For instance, if you had UPDATE privileges, you could lock a table in any lock mode except ACCESS SHARE mode. Now, if granted a privilege to lock at a given mode, one also has privileges to lock at a less-conflicting mode. MAINTAIN, UPDATE, DELETE, and TRUNCATE privileges allow any lock mode. INSERT privileges allow ROW EXCLUSIVE (or below). SELECT privileges allow ACCESS SHARE. Reviewed-by: Nathan Bossart Discussion: https://postgr.es/m/9550c76535404a83156252b25a11babb4792ea1e.camel%40j-davis.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/lock.sgml | modified | +13 −12 |
| src/backend/commands/lockcmds.c | modified | +9 −9 |
| src/test/regress/expected/privileges.out | modified | +28 −38 |
| src/test/regress/sql/privileges.sql | modified | +29 −32 |
Documentation touched
Discussion
- Rework confusing permissions for LOCK TABLE 3 messages · 2022-12-14 → 2022-12-30