From a54141aebcafa02cba5204596758dadbbeb0f78e Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 4 Oct 2013 13:50:28 -0400 Subject: Issue error on SET outside transaction block in some cases Issue error for SET LOCAL/CONSTRAINTS/TRANSACTION outside a transaction block, as they have no effect. Per suggestion from Morten Hustveit --- doc/src/sgml/ref/set.sgml | 7 +++---- doc/src/sgml/ref/set_constraints.sgml | 2 +- doc/src/sgml/ref/set_transaction.sgml | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/set.sgml b/doc/src/sgml/ref/set.sgml index 21745db4627..d108dd4831c 100644 --- a/doc/src/sgml/ref/set.sgml +++ b/doc/src/sgml/ref/set.sgml @@ -110,10 +110,9 @@ SET [ SESSION | LOCAL ] TIME ZONE { timezone Specifies that the command takes effect for only the current transaction. After COMMIT or ROLLBACK, - the session-level setting takes effect again. Note that - SET LOCAL will appear to have no effect if it is - executed outside a BEGIN block, since the - transaction will end immediately. + the session-level setting takes effect again. + PostgreSQL reports an error if + SET LOCAL is used outside a transaction block. diff --git a/doc/src/sgml/ref/set_constraints.sgml b/doc/src/sgml/ref/set_constraints.sgml index 8098b7b6678..895a5fdbc0e 100644 --- a/doc/src/sgml/ref/set_constraints.sgml +++ b/doc/src/sgml/ref/set_constraints.sgml @@ -102,7 +102,7 @@ SET CONSTRAINTS { ALL | name [, ... current transaction. Thus, if you execute this command outside of a transaction block (BEGIN/COMMIT pair), it will - not appear to have any effect. + generate an error. diff --git a/doc/src/sgml/ref/set_transaction.sgml b/doc/src/sgml/ref/set_transaction.sgml index f0607296802..391464ade83 100644 --- a/doc/src/sgml/ref/set_transaction.sgml +++ b/doc/src/sgml/ref/set_transaction.sgml @@ -184,9 +184,8 @@ SET SESSION CHARACTERISTICS AS TRANSACTION transa If SET TRANSACTION is executed without a prior - START TRANSACTION or BEGIN, - it will appear to have no effect, since the transaction will immediately - end. + START TRANSACTION or BEGIN, + it will generate an error. -- cgit v1.2.3