From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Simplify permissions for LOCK TABLE.
Date: Fri, 13 Jan 2023 22:39:16 +0000
Message-ID: <E1pGShf-003WBy-Ly@gemulon.postgresql.org> (raw)
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c44f6334ca6ff6d242d9eb6742441bc4e1294067
Modified Files
--------------
doc/src/sgml/ref/lock.sgml | 25 ++++++------
src/backend/commands/lockcmds.c | 18 ++++-----
src/test/regress/expected/privileges.out | 66 ++++++++++++++------------------
src/test/regress/sql/privileges.sql | 61 ++++++++++++++---------------
4 files changed, 79 insertions(+), 91 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: jdavis@postgresql.org
Subject: Re: pgsql: Simplify permissions for LOCK TABLE.
In-Reply-To: <E1pGShf-003WBy-Ly@gemulon.postgresql.org>
References: <E1pGShf-003WBy-Ly@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox