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

From Andres Freund
Subject Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block
Date
Msg-id 20131119181716.GD22498@alap2.anarazel.de
Whole thread Raw
In response to Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On 2013-11-19 13:14:34 -0500, Bruce Momjian wrote:
> On Tue, Nov 19, 2013 at 07:12:32PM +0100, Andres Freund wrote:
> > But even if that weren't a concern, the fact that BEGIN does it one way
> > currently doesn't seem very indicative of changing other historical behaviour.
> 
> Look at this gem, which returns notice:
> 
>     test=> ABORT;
>     NOTICE:  there is no transaction in progress
>     ROLLBACK
>     test=>
> 
> We are all over the map on this!  The big question is whether we want to
> add some sanity to this, or just leave it alone, and if we leave it
> alone, what pattern do we use for the new checks?

I think changing a NOTICE into a WARNING or the reverse is fine,
changing a WARNING/NOTICE into an ERROR or the reverse is something
which should be done only very hesitantly.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Atri Sharma
Date:
Subject: Re: stats for network traffic WIP
Next
From: David Johnston
Date:
Subject: Re: Suggestion: Issue warning when calling SET TRANSACTION outside transaction block