From 2dbbda02e7e688311e161a912a0ce00cde9bb6fc Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Wed, 28 Jul 2010 05:22:24 +0000 Subject: Reduce lock levels of CREATE TRIGGER and some ALTER TABLE, CREATE RULE actions. Avoid hard-coding lockmode used for many altering DDL commands, allowing easier future changes of lock levels. Implementation of initial analysis on DDL sub-commands, so that many lock levels are now at ShareUpdateExclusiveLock or ShareRowExclusiveLock, allowing certain DDL not to block reads/writes. First of number of planned changes in this area; additional docs required when full project complete. --- doc/src/sgml/mvcc.sgml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml index 341351e46ff..e72a32c58ee 100644 --- a/doc/src/sgml/mvcc.sgml +++ b/doc/src/sgml/mvcc.sgml @@ -1,4 +1,4 @@ - + Concurrency Control @@ -532,7 +532,7 @@ SELECT SUM(value) FROM mytab WHERE class = 2; most PostgreSQL commands automatically acquire locks of appropriate modes to ensure that referenced tables are not dropped or modified in incompatible ways while the - command executes. (For example, ALTER TABLE cannot safely be + 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.) @@ -695,8 +695,9 @@ SELECT SUM(value) FROM mytab WHERE class = 2; - This lock mode is not automatically acquired by any - PostgreSQL command. + Acquired by CREATE TRIGGER, + CREATE RULE (except for ON SELECT + rules) and in some cases ALTER TABLE. @@ -742,11 +743,12 @@ SELECT SUM(value) FROM mytab WHERE class = 2; - Acquired by the ALTER TABLE, DROP - TABLE, TRUNCATE, REINDEX, + Acquired by the DROP TABLE, + TRUNCATE, REINDEX, CLUSTER, and VACUUM FULL - commands. This is also the default lock mode for LOCK - TABLE statements that do not specify a mode explicitly. + commands, as well as most variants of ALTER TABLE. + This is also the default lock mode for LOCK TABLE + statements that do not specify a mode explicitly. -- cgit v1.2.3