On Mon, 29 Apr 2002, Bruce Momjian wrote:
> Hannu Krosing wrote:
> > On Mon, 2002-04-29 at 17:09, Scott Marlowe wrote:
> > > For this reason, I propose that a transaction should "inherit" its
> > > environment, and that all changes EXCEPT for those affecting tuples should
> > > be rolled back after completion, leaving the environment the way we found
> > > it. If you need the environment changed, do it OUTSIDE the transaction.
> >
> > Unfortunately there is no such time in postgresql where commands are
> > done outside transaction.
> >
> > If you don't issue BEGIN; then each command is implicitly run in its own
> > transaction.
> >
> > Rolling each command back unless it is in implicit transaction would
> > really confuse the user.
>
> Agreed, very non-intuitive. And can you imagine how many applications
> we would break.
Since there is obviously no defined standard for how a SET should be
treated within a transaction ... who cares? God, how many changes have we
made in the past that "break applications" but did them anyway?
Just as a stupid question here ... but, why do we wrap single queries into
a transaction anyway? IMHO, a transaction is meant to tell the backend to
remember this sequence of events, so that if it fails, you can roll it
back ... with a single INSERT/UPDATE/DELETE, why 'auto-wrapper' it with a
BEGIN/END?