LOCK docs and permissions

Started by PG Bug reporting formabout 2 years ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/explicit-locking.html
Description:

Hello,

It appears that LOCK on a schema.table requires particular permissions but I
can’t find which ones need to be granted in a schema.table in order to lock
said table.

I think it would help to add a short blurb on that?

Thank you!
Jens

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: PG Bug reporting form (#1)
Re: LOCK docs and permissions

On Fri, 2024-04-05 at 10:25 +0000, PG Doc comments form wrote:

Page: https://www.postgresql.org/docs/16/explicit-locking.html
Description:

It appears that LOCK on a schema.table requires particular permissions but I
can’t find which ones need to be granted in a schema.table in order to lock
said table.

I think it would help to add a short blurb on that?

https://www.postgresql.org/docs/current/sql-lock.html#id-1.9.3.155.7

"To lock a table, the user must have the right privilege for the specified
lockmode, or be the table's owner or a superuser. If the user has UPDATE,
DELETE, or TRUNCATE privileges on the table, any lockmode is permitted.
If the user has INSERT privileges on the table, ROW EXCLUSIVE MODE
(or a less-conflicting mode as described in Section 13.3) is permitted.
If a user has SELECT privileges on the table, ACCESS SHARE MODE is permitted."

Yours,
Laurenz Albe

#3Jens Tröger
jens.troeger@light-speed.de
In reply to: Laurenz Albe (#2)
Re: LOCK docs and permissions

Thank you, Laurenz, I missed that completely 🤦🏻‍♂️
Jens

Show quoted text

https://www.postgresql.org/docs/current/sql-lock.html#id-1.9.3.155.7

"To lock a table, the user must have the right privilege for the specified
lockmode, or be the table's owner or a superuser. If the user has UPDATE,
DELETE, or TRUNCATE privileges on the table, any lockmode is permitted.
If the user has INSERT privileges on the table, ROW EXCLUSIVE MODE
(or a less-conflicting mode as described in Section 13.3) is permitted.
If a user has SELECT privileges on the table, ACCESS SHARE MODE is permitted."

Yours,
Laurenz Albe