Search Postgresql Archives

Re: psql swallowed my "BEGIN;" on reset... user beware?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux