Re: [subxacts] Savepoint syntax

Lists: pgsql-patches
From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: [subxacts] Savepoint syntax
Date: 2004-07-14 19:03:02
Message-ID: 20040714190302.GB15098@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Ok people,

After the last holy war on syntax issues I have been convinced that
savepoints are not that brain dead as it appears. (They nest correctly
and "release" is equivalent to my "subcommit"). The only bitter point
is that on ROLLBACK TO the same savepoint is created again
automatically.

So I have dropped the idea of the propietary syntax. This patch
implements proper savepoint syntax. Includes regression tests but no
documentation is provided yet.

Note that this does not include other patches I'm working on, regarding
PGPROC, the password file, large objects, whole-tree abort on deadlock,
handling of subxacts in functions etc. I'll submit those separately.
(It does include reverting XactLockTableWait to the previous state
though).

Note that I created a new ERRCODE class, 3B000, "Savepoint Exception",
with a single member, "Invalid Specification" 3B001. This is what the
standard mandates when you RELEASE a non existant savepoint, etc. Hope
this is OK. Also, you can't create or release a savepoint on aborted
state (only COMMIT, END, ROLLBACK and ROLLBACK TO are accepted).

Please test, review and apply. If anyone is able to crash the server
using this I'll be most interested.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Thou shalt study thy libraries and strive not to reinvent them without
cause, that thy code may be short and readable and thy days pleasant
and productive. (7th Commandment for C Programmers)

Attachment Content-Type Size
savepoints-1.patch text/plain 67.3 KB

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [subxacts] Savepoint syntax
Date: 2004-07-14 23:48:18
Message-ID: 1089848898.17493.5084.camel@stromboli
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Wed, 2004-07-14 at 20:03, Alvaro Herrera wrote:
> So I have dropped the idea of the propietary syntax. This patch
> implements proper savepoint syntax. Includes regression tests but no
> documentation is provided yet.

Excellent. Thank you very much for your efforts.

Many thanks, Simon Riggs


From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [subxacts] Savepoint syntax
Date: 2004-07-16 05:44:12
Message-ID: 20040716054411.GA21965@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Wed, Jul 14, 2004 at 03:03:02PM -0400, Alvaro Herrera wrote:

> Please test, review and apply. If anyone is able to crash the server
> using this I'll be most interested.

I just noticed that the "misc" regression test is generated, and so it
needs to be patched ... interdiff output attached.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Entristecido, Wutra (canción de Las Barreras)
echa a Freyr a rodar
y a nosotros al mar"

Attachment Content-Type Size
diff text/plain 426 bytes