From 31b15fe8dcd2e026afc0b566f50141ae9a7273b5 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 4 Nov 2008 00:57:19 +0000 Subject: Disallow LOCK TABLE outside a transaction block (or function), since this case almost certainly represents user error. Per a gripe from Sebastian Böhm and subsequent discussion. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/src/sgml/ref/declare.sgml | 7 +++---- doc/src/sgml/ref/lock.sgml | 17 ++++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/declare.sgml b/doc/src/sgml/ref/declare.sgml index 269d2c101c4..744cda77726 100644 --- a/doc/src/sgml/ref/declare.sgml +++ b/doc/src/sgml/ref/declare.sgml @@ -1,5 +1,5 @@ @@ -175,10 +175,9 @@ DECLARE name [ BINARY ] [ INSENSITI PostgreSQL reports an error if such a command is used outside a transaction block. Use - , + and - and - + (or ) to define a transaction block. diff --git a/doc/src/sgml/ref/lock.sgml b/doc/src/sgml/ref/lock.sgml index d32e6d364c8..701c2a19a48 100644 --- a/doc/src/sgml/ref/lock.sgml +++ b/doc/src/sgml/ref/lock.sgml @@ -1,5 +1,5 @@ @@ -160,12 +160,15 @@ where lockmode is one of: - LOCK TABLE is useful only inside a transaction - block (BEGIN/COMMIT pair), since the lock - is dropped as soon as the transaction ends. A LOCK - TABLE command appearing outside any transaction block forms a - self-contained transaction, so the lock will be dropped as soon as - it is obtained. + LOCK TABLE is useless outside a transaction block: the lock + would remain held only to the completion of the statement. Therefore + PostgreSQL reports an error if LOCK + is used outside a transaction block. + Use + and + + (or ) + to define a transaction block. -- cgit v1.2.3