diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 7538200d01..b5ebca8c27 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -2031,7 +2031,8 @@ SELECT * FROM information WHERE group_id = 2 FOR UPDATE; definer function.) Also, heavy concurrent use of row share locks on the referenced table could pose a performance problem, especially if updates of it are frequent. Another solution, practical if updates of the - referenced table are infrequent, is to take an exclusive lock on the + referenced table are infrequent, is to take an + ACCESS EXCLUSIVE lock on the referenced table when updating it, so that no concurrent transactions could be examining old row values. Or one could just wait for all concurrent transactions to end after committing an update of the diff --git a/doc/src/sgml/hstore.sgml b/doc/src/sgml/hstore.sgml index 9cb96bd8d3..d046eba760 100644 --- a/doc/src/sgml/hstore.sgml +++ b/doc/src/sgml/hstore.sgml @@ -610,7 +610,8 @@ UPDATE tablename SET hstorecol = hstorecol || ''; ALTER TABLE tablename ALTER hstorecol TYPE hstore USING hstorecol || ''; - The ALTER TABLE method requires an exclusive lock on the table, + The ALTER TABLE method requires an + ACCESS EXCLUSIVE lock on the table, but does not result in bloating the table with old row versions. diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/indexam.sgml index 843fa1dcf4..f69f15627c 100644 --- a/doc/src/sgml/indexam.sgml +++ b/doc/src/sgml/indexam.sgml @@ -897,8 +897,8 @@ amparallelrescan (IndexScanDesc scan); RowExclusiveLock when updating the index (including plain VACUUM). Since these lock types do not conflict, the access method is responsible for handling any fine-grained locking it might need. - An exclusive lock on the index as a whole will be taken only during index - creation, destruction, or REINDEX. + An ACCESS EXCLUSIVE lock on the index as a whole will be + taken only during index creation, destruction, or REINDEX. diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index 3b649575e9..fb08c9ece1 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -128,7 +128,8 @@ DELETE will continue to function normally, though you will not be able to modify the definition of a table with commands such as ALTER TABLE while it is being vacuumed.) - VACUUM FULL requires exclusive lock on the table it is + VACUUM FULL requires an + ACCESS EXCLUSIVE lock on the table it is working on, and therefore cannot be done in parallel with other use of the table. Generally, therefore, administrators should strive to use standard VACUUM and @@ -231,7 +232,8 @@ or one of the table-rewriting variants of . These commands rewrite an entire new copy of the table and build - new indexes for it. All these options require exclusive lock. Note that + new indexes for it. All these options require an + ACCESS EXCLUSIVE lock. Note that they also temporarily use extra disk space approximately equal to the size of the table, since the old copies of the table and indexes can't be released until the new ones are complete. diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml index 6341174f5d..7e20a8a796 100644 --- a/doc/src/sgml/mvcc.sgml +++ b/doc/src/sgml/mvcc.sgml @@ -826,7 +826,8 @@ ERROR: could not serialize access due to read/write dependencies among transact tables are not dropped or modified in incompatible ways while the command executes. (For example, TRUNCATE cannot safely be executed concurrently with other operations on the same table, so it - obtains an exclusive lock on the table to enforce that.) + obtains an ACCESS EXCLUSIVE lock on the table to + enforce that.) diff --git a/doc/src/sgml/pgrowlocks.sgml b/doc/src/sgml/pgrowlocks.sgml index 60e13393ea..392d5f1f9a 100644 --- a/doc/src/sgml/pgrowlocks.sgml +++ b/doc/src/sgml/pgrowlocks.sgml @@ -97,8 +97,8 @@ pgrowlocks(text) returns setof record - If the table as a whole is exclusive-locked by someone else, - pgrowlocks will be blocked. + If an ACCESS EXCLUSIVE lock is taken on the table, + pgrowlocks will be blocked. diff --git a/doc/src/sgml/ref/drop_index.sgml b/doc/src/sgml/ref/drop_index.sgml index b6d2c2014f..aabc85e230 100644 --- a/doc/src/sgml/ref/drop_index.sgml +++ b/doc/src/sgml/ref/drop_index.sgml @@ -45,9 +45,10 @@ DROP INDEX [ CONCURRENTLY ] [ IF EXISTS ] name Drop the index without locking out concurrent selects, inserts, updates, and deletes on the index's table. A normal DROP INDEX - acquires an exclusive lock on the table, blocking other accesses until the - index drop can be completed. With this option, the command instead - waits until conflicting transactions have completed. + acquires an ACCESS EXCLUSIVE lock on the table, + blocking other accesses until the index drop can be completed. With + this option, the command instead waits until conflicting transactions + have completed. There are several caveats to be aware of when using this option. diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml index 47cef987d4..270b828cd1 100644 --- a/doc/src/sgml/ref/reindex.sgml +++ b/doc/src/sgml/ref/reindex.sgml @@ -213,14 +213,15 @@ REINDEX [ ( VERBOSE ) ] { INDEX | TABLE | SCHEMA | DATABASE | SYSTEM } REINDEX is similar to a drop and recreate of the index in that the index contents are rebuilt from scratch. However, the locking considerations are rather different. REINDEX locks out writes - but not reads of the index's parent table. It also takes an exclusive lock - on the specific index being processed, which will block reads that attempt - to use that index. In contrast, DROP INDEX momentarily takes - an exclusive lock on the parent table, blocking both writes and reads. The - subsequent CREATE INDEX locks out writes but not reads; since - the index is not there, no read will attempt to use it, meaning that there - will be no blocking but reads might be forced into expensive sequential - scans. + but not reads of the index's parent table. It also takes an + ACCESS EXCLUSIVE lock on the specific index being processed, + which will block reads that attempt to use that index. In contrast, + DROP INDEX momentarily takes an + ACCESS EXCLUSIVE lock on the parent table, blocking both + writes and reads. The subsequent CREATE INDEX locks out + writes but not reads; since the index is not there, no read will attempt to + use it, meaning that there will be no blocking but reads might be forced + into expensive sequential scans. diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml index b760e8ede1..fcae8e5acb 100644 --- a/doc/src/sgml/ref/vacuum.sgml +++ b/doc/src/sgml/ref/vacuum.sgml @@ -75,7 +75,8 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ ANALYZE ] [