Re: SET autocommit begins transaction?

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Rod Taylor <rbt(at)rbt(dot)ca>, Thomas Lockhart <lockhart(at)fourpalms(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: SET autocommit begins transaction?
Date: 2002-09-19 00:32:52
Message-ID: 20020919003252.GC6389@perrin.int.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> > Of course, the reason they're rollbackable is:
> >
> > begin;
> > create schema newschema;
> > set search_path = newschema;
> > rollback;
> >
> > create table junk; -- DOH!
>
> And:
>
> set statement_timeout = 20;
> query_with_error;
> set statement_timeout = 0;
> COMMIT;
>
> That will have to change in autocommit off to:
>
> BEGIN;
> SET statement_timeout = 20;
> query_with_error;
> SET statement_timeout = 0;
> COMMIT;
>
> I assume that BEGIN does start a transaction. With no BEGIN above, the
> big problem is that it will work most of the time, but when/if the query
> fails, they will find out they forgot the BEGIN.

Wouldn't it roll back to 0 though because the SET statement_timeout TO
20 was inside of a transaction (assuming the value was 0 before the
transaction began)? -sc

--
Sean Chittenden

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Rod Taylor 2002-09-19 00:41:52 Re: Bug #772: Rewriting on multi-record updates is
Previous Message Bruce Momjian 2002-09-19 00:30:31 Re: SET autocommit begins transaction?