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 1385484853030-5780378.post@n5.nabble.com
Whole thread Raw
In response to Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block
List pgsql-hackers
Bruce Momjian wrote
>> >> -   Issuing 
> <command>
> ABORT
> </>
>  when not inside a transaction does
>> >> -   no harm, but it will provoke a warning message.
>> >> +   Issuing 
> <command>
> ABORT
> </>
>  outside of a transaction block has no effect.
>> >> 
>> >> Those things are not the same.
>> 
>> > Uh, I ended up mentioning "no effect" to highlight it does nothing,
>> > rather than mention a warning.  Would people prefer I say "warning"? 
>> Or
>> > should I say "issues a warning because it has no effect" or something? 
>> > It is easy to change.
>> 
>> I'd revert the change Robert highlights above.  ISTM you've changed the
>> code to match the documentation; why would you then change the docs?
> 
> Well, I did it to make it consistent.  The question is what to write for
> _all_ of the new warnings, including SET.  Do we say "warning", do we
> say "it has no effect", or do we say both?  The ABORT is a just one case
> of that.

How about:

"Issuing <command> outside of a transaction has no effect and will provoke a
warning."

I dislike "does no harm" because it can if someone thinks the current state
is different than reality.

It is good to indicate that a warning is emitted if this is done in error;
thus reinforcing the fact people should be looking at their warnings.

"when not inside" uses a negative modifier while "outside" is more direct
and thus easier to read, IMO.  The phrase "transaction block" seems wordy so
I omitted the word "block".

David J.




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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Logging WAL when updating hintbit
Next
From: Gurjeet Singh
Date:
Subject: Cleaner build output when not much has changed