Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block - Mailing list pgsql-hackers

From David Johnston
Subject Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block
Date
Msg-id 1385694968047-5780825.post@n5.nabble.com
Whole thread Raw
In response to Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Robert Haas wrote
>> 
>>     Issuing 
> <command>
> ROLLBACK
> </>
>  outside of a transaction
>>     block has the sole effect of emitting a warning.
> 
> Sure, that sounds OK.
> 
> ...Robert

+1 for:

Issuing <command>ROLLBACK</> outside of a transaction 
block has no effect except emitting a warning. 

In all of these cases we are assuming that the user understands that
emitting a warning means that something is being logged to disk and thus is
causing a resource drain.

I like explicitly saying that issuing these commands is pointless/"has no
effect"; being indirect and saying that the only thing they do is emit a
warning omits any explicit explicit explanation of why.  And while I agree
that logging the warning is an effect; but it is not the primary/direct
effect that the user cares about.

I would maybe change the above to:

*Issuing <command>ROLLBACK</> outside of a transaction block has no effect:
thus it emits a warning [to both user and log file].*

I do like "thus" instead of "except" due to the explicit causality link that
is establishes.  We emit a warning because what you just did is pointless.

David J.







--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Suggestion-Issue-warning-when-calling-SET-TRANSACTION-outside-transaction-block-tp5743139p5780825.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: docbook-xsl version for release builds
Next
From: Peter Eisentraut
Date:
Subject: Re: Modify the DECLARE CURSOR command tag depending on the scrollable flag