Re: Multiple semicolon separated statements and autocommit

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Rene Pijlman" <rene(at)lab(dot)applinet(dot)nl>
Cc: <pgsql-hackers(at)postgresql(dot)org>, <barry(at)xythos(dot)com>
Subject: Re: Multiple semicolon separated statements and autocommit
Date: 2001-08-31 01:14:21
Message-ID: ECEHIKNFIMMECLEBJFIGCELHCBAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Are you sure? I thought all that autocommit meant was that a statement that
is not enclosed within a begin/commit is automatically committed after it is
run. So, in the this case all three queries will be independent, unless the
first statements is a 'begin;' and the last is a 'commit;'...

Chris

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org]On Behalf Of Peter Eisentraut
> Sent: Friday, 31 August 2001 1:57 AM
> To: Rene Pijlman
> Cc: pgsql-hackers(at)postgresql(dot)org; barry(at)xythos(dot)com
> Subject: Re: [HACKERS] Multiple semicolon separated statements and
> autocommit
>
>
> Rene Pijlman writes:
>
> > If autocommit is _enabled_ and S1;S2;S3 is send to the database,
> > what exactly is the behaviour of the backend? For example, what
> > happens if S1 succeeds, S2 fails and S3 would succeed?
>
> All three commands are executed in a single transaction. So if S2 fails,
> S3 would not be executed.
>
> --
> Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mitch Vincent 2001-08-31 01:27:28 Re: Escaping strings for inclusion into SQL queries
Previous Message Florian Weimer 2001-08-31 00:37:26 Re: Escaping strings for inclusion into SQL queries