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

2013-12-02 Thread Bruce Momjian
On Fri, Nov 29, 2013 at 01:19:54PM -0500, Bruce Momjian wrote: On Fri, Nov 29, 2013 at 01:05:20PM -0500, Bruce Momjian wrote: On Fri, Nov 29, 2013 at 12:27:49AM -0500, Robert Haas wrote: On Thu, Nov 28, 2013 at 11:04 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: David Johnston

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

2013-11-29 Thread Bruce Momjian
On Fri, Nov 29, 2013 at 12:27:49AM -0500, Robert Haas wrote: I wish we'd just left this whole thing well enough alone. It wasn't broken, and didn't need fixing. Well, this started with a complaint that one SET command outside of a transaction had no effect, and expanded to other SET commands

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

2013-11-29 Thread Bruce Momjian
On Fri, Nov 29, 2013 at 12:27:49AM -0500, Robert Haas wrote: On Thu, Nov 28, 2013 at 11:04 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: David Johnston wrote: In all of these cases we are assuming that the user understands that emitting a warning means that something is being logged

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

2013-11-29 Thread Bruce Momjian
On Fri, Nov 29, 2013 at 01:05:20PM -0500, Bruce Momjian wrote: On Fri, Nov 29, 2013 at 12:27:49AM -0500, Robert Haas wrote: On Thu, Nov 28, 2013 at 11:04 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: David Johnston wrote: In all of these cases we are assuming that the user

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

2013-11-28 Thread David Johnston
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 commandROLLBACK/ outside of a transaction block has no effect except emitting a warning. In all of

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

2013-11-28 Thread Alvaro Herrera
David Johnston wrote: 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

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

2013-11-28 Thread Robert Haas
On Thu, Nov 28, 2013 at 11:04 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: David Johnston wrote: 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

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

2013-11-26 Thread David Johnston
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

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

2013-11-26 Thread Bruce Momjian
On Tue, Nov 26, 2013 at 08:54:13AM -0800, David Johnston wrote: 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

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

2013-11-19 Thread Robert Haas
On Mon, Nov 18, 2013 at 9:07 PM, Bruce Momjian br...@momjian.us wrote: Well, ERROR is what LOCK returns, so if we change SET TRANSACTION to be WARNING, we should change LOCK too, so on backward-compatibility grounds, ERROR makes more sense. Personally, I am fine with changing them all to

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

2013-11-19 Thread David Johnston
Robert Haas wrote On Mon, Nov 18, 2013 at 9:07 PM, Bruce Momjian lt; bruce@ gt; wrote: Well, ERROR is what LOCK returns, so if we change SET TRANSACTION to be WARNING, we should change LOCK too, so on backward-compatibility grounds, ERROR makes more sense. Personally, I am fine with

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

2013-11-19 Thread Robert Haas
On Tue, Nov 19, 2013 at 11:53 AM, David Johnston pol...@yahoo.com wrote: Well, at this point we have already broken backward compatibility by releasing this. With Tom's thread necromancy I missed the fact this got released in 9.3 Eh, really? I don't see it in 9.3. -- Robert Haas

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

2013-11-19 Thread Tom Lane
David Johnston pol...@yahoo.com writes: Robert Haas wrote I don't think it's worth breaking backward compatibility. I'm not entirely sure what I would have decided here in a vacuum, but at this point existing precedent seems determinative. Well, at this point we have already broken backward

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

2013-11-19 Thread Bruce Momjian
On Tue, Nov 19, 2013 at 12:24:50PM -0500, Tom Lane wrote: David Johnston pol...@yahoo.com writes: Robert Haas wrote I don't think it's worth breaking backward compatibility. I'm not entirely sure what I would have decided here in a vacuum, but at this point existing precedent seems

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

2013-11-19 Thread David Johnston
Tom Lane-2 wrote David Johnston lt; polobo@ gt; writes: Robert Haas wrote I don't think it's worth breaking backward compatibility. I'm not entirely sure what I would have decided here in a vacuum, but at this point existing precedent seems determinative. Well, at this point we have

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

2013-11-18 Thread David Johnston
Bruce Momjian wrote Considering we are doing this outside of a transaction, and WARNING or ERROR is pretty much the same, from a behavioral perspective. Should we change this and LOCK to be a warning? From the calling application's perspective an error and a warning are definitely

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

2013-11-18 Thread Bruce Momjian
On Mon, Nov 18, 2013 at 05:05:45PM -0800, David Johnston wrote: Bruce Momjian wrote Considering we are doing this outside of a transaction, and WARNING or ERROR is pretty much the same, from a behavioral perspective. Should we change this and LOCK to be a warning? From the calling

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

2013-11-18 Thread David Johnston
Bruce Momjian wrote On Mon, Nov 18, 2013 at 05:05:45PM -0800, David Johnston wrote: Bruce Momjian wrote Considering we are doing this outside of a transaction, and WARNING or ERROR is pretty much the same, from a behavioral perspective. Should we change this and LOCK to be a warning?

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

2013-11-18 Thread Bruce Momjian
On Mon, Nov 18, 2013 at 06:30:32PM -0800, David Johnston wrote: Personally, I am fine with changing them all to WARNING. Error makes more sense if the goal is internal consistency. That goal should be subservient to backward compatibility. Changing LOCK to warning is less problematic

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

2013-11-18 Thread David Johnston
Bruce Momjian wrote On Mon, Nov 18, 2013 at 06:30:32PM -0800, David Johnston wrote: Personally, I am fine with changing them all to WARNING. Error makes more sense if the goal is internal consistency. That goal should be subservient to backward compatibility. Changing LOCK to warning is