[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] psql swallowed my "BEGIN;" on reset... user beware?
From:       Ken Tanzer <ken.tanzer () gmail ! com>
Date:       2013-09-30 23:23:58
Message-ID: CAD3a31XtkWNFnzPHHfasZFDTZPyVTp-nFxaTEX-bYR2DwH1nTw () mail ! gmail ! com
[Download RAW message or body]

>
> you can control this with on error stop directive -- add it to your
> psqlrc if you want the setting to persist.


I hear what you're saying, but wonder about the implications:

It sounds like you can't trust your BEGIN to actually start a transaction
unless on_error_stop is set

The default for on_error_stop seems to be off, so at a minimum this is a
default gotcha waiting to happen.  At the very least, perhaps the
documentation for BEGIN and ON_ERROR_STOP should mention this?

Should BEGIN be a special case?  The operator clearly wants the subsequent
commands to run together or not at all.  I'm having trouble imagining any
scenario under which one would want their commands to continue after a
failed BEGIN, especially if it happens at random times outside of one's
control.

Is your response based on belief that the current behavior is good, or a
concern about changing the way psql works, or undesired side effects from
changing it?  I could understand any of those--just curious what your
thinking is!

Cheers,
Ken

[Attachment #3 (text/html)]

<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">you \
can control this with on error stop directive -- add it to your<br>

psqlrc if you want the setting to persist.</blockquote><div class="gmail_extra"><br>I \
hear what you&#39;re saying, but wonder about the implications: </div><div \
class="gmail_extra"><br></div><div class="gmail_extra">It sounds like you can&#39;t \
trust your BEGIN to actually start a transaction unless on_error_stop is \
set</div><div class="gmail_extra"><br></div><div class="gmail_extra">

The default for on_error_stop seems to be off, so at a minimum this is a default \
gotcha waiting to happen.  At the very least, perhaps the documentation for BEGIN and \
ON_ERROR_STOP should mention this?</div><div class="gmail_extra">

<br></div><div class="gmail_extra">Should BEGIN be a special case?  The operator \
clearly wants the subsequent commands to run together or not at all.  I&#39;m having \
trouble imagining any scenario under which one would want their commands to continue \
after a failed BEGIN, especially if it happens at random times outside of one&#39;s \
control.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">Is your response based on \
belief that the current behavior is good, or a concern about changing the way psql \
works, or undesired side effects from changing it?  I could understand any of \
those--just curious what your thinking is!</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,</div><div \
class="gmail_extra">Ken</div><div class="gmail_extra"><br></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic