Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block
Date: 2013-11-26 16:54:13
Message-ID: 1385484853030-5780378.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2013-11-26 16:57:45 Cleaner build output when not much has changed
Previous Message Peter Eisentraut 2013-11-26 16:44:08 Re: Logging WAL when updating hintbit