Skip to content

Commit e58345f

Browse files
committed
doc: Mention the level of locks taken on objects in COMMENT
This information was nowhere to be found. This adds one note on the page of COMMENT, and one note in the section dedicated to explicit locking, both telling that a SHARE UPDATE EXCLUSIVE lock is taken on the object commented. Author: Nikolai Berkoff Reviewed-by: Laurenz Albe Discussion: https://postgr.es/m/_0HDHIGcCdCsUyXn22QwI2FEuNR6Fs71rtgGX6hfyBlUh5rrnE2qMmvIFu9EY4Pijr2gUmJEAXCjuNU2Oxku9TryLp9CdHllpsCfN3gD0-Y=@pm.me Backpatch-through: 10
1 parent 5940d1b commit e58345f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

doc/src/sgml/mvcc.sgml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -950,11 +950,12 @@ ERROR: could not serialize access due to read/write dependencies among transact
950950
<para>
951951
Acquired by <command>VACUUM</command> (without <option>FULL</option>),
952952
<command>ANALYZE</command>, <command>CREATE INDEX CONCURRENTLY</command>,
953+
<command>CREATE STATISTICS</command>, <command>COMMENT ON</command>,
953954
<command>REINDEX CONCURRENTLY</command>,
954-
<command>CREATE STATISTICS</command>, and certain <command>ALTER
955-
INDEX</command> and <command>ALTER TABLE</command> variants (for full
956-
details see <xref linkend="sql-alterindex"/> and <xref
957-
linkend="sql-altertable"/>).
955+
and certain <command>ALTER INDEX</command> and
956+
<command>ALTER TABLE</command> variants
957+
(for full details see <xref linkend="sql-alterindex"/> and
958+
<xref linkend="sql-altertable"/>).
958959
</para>
959960
</listitem>
960961
</varlistentry>

doc/src/sgml/ref/comment.sgml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ COMMENT ON
9090
Comments are automatically dropped when their object is dropped.
9191
</para>
9292

93+
<para>
94+
A <literal>SHARE UPDATE EXCLUSIVE</literal> lock is acquired on the
95+
object to be commented.
96+
</para>
97+
9398
<para>
9499
For most kinds of object, only the object's owner can set the comment.
95100
Roles don't have owners, so the rule for <literal>COMMENT ON ROLE</literal> is

0 commit comments

Comments
 (0)