From 0ef0396ae1687bf738d4703773d55467c36b2bcd Mon Sep 17 00:00:00 2001
From: Simon Riggs
Date: Sun, 5 Apr 2015 11:37:08 -0400
Subject: Reduce lock levels of some trigger DDL and add FKs
Reduce lock levels to ShareRowExclusive for the following SQL
CREATE TRIGGER (but not DROP or ALTER)
ALTER TABLE ENABLE TRIGGER
ALTER TABLE DISABLE TRIGGER
ALTER TABLE … ADD CONSTRAINT FOREIGN KEY
Original work by Simon Riggs, extracted and refreshed by Andreas Karlsson
New test cases added by Andreas Karlsson
Reviewed by Noah Misch, Andres Freund, Michael Paquier and Simon Riggs
---
doc/src/sgml/mvcc.sgml | 12 ++++++------
doc/src/sgml/ref/alter_table.sgml | 3 +++
2 files changed, 9 insertions(+), 6 deletions(-)
(limited to 'doc/src')
diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml
index e43a3be6d4e..958adc32bd3 100644
--- a/doc/src/sgml/mvcc.sgml
+++ b/doc/src/sgml/mvcc.sgml
@@ -909,9 +909,9 @@ ERROR: could not serialize access due to read/write dependencies among transact
- This lock mode is not automatically acquired by any
- PostgreSQL command.
-
+ Acquired by CREATE TRIGGER and many forms of
+ ALTER TABLE (see ).
+ >
@@ -958,9 +958,9 @@ ERROR: could not serialize access due to read/write dependencies among transact
TRUNCATE, REINDEX,
CLUSTER, and VACUUM FULL
commands. Many forms of ALTER TABLE> also acquire
- a lock at this level (see ).
- This is also the default lock mode for LOCK TABLE
- statements that do not specify a mode explicitly.
+ a lock at this level. This is also the default lock mode for
+ LOCK TABLE statements that do not specify
+ a mode explicitly.
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 19baf2961a4..6a82730a4b4 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -406,6 +406,9 @@ ALTER TABLE ALL IN TABLESPACE name
mode, and triggers configured as ENABLE ALWAYS will
fire regardless of the current replication mode.
+
+ This command acquires a SHARE ROW EXCLUSIVE lock.
+
--
cgit v1.2.3