Re: [HACKERS] SAVEPOINT syntax again

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] SAVEPOINT syntax again
Date: 2004-08-11 23:45:07
Message-ID: 411AAF83.8010907@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Making the assumption that we want standards-conforming syntax here, I
went ahead and did the necessary changes:

Oliver Jowett wrote:

> Comments:
>
> 1) We have a different syntax to the SQL200n draft (and Oracle by the
> looks of it) for ROLLBACK. The draft says:
>
>> <rollback statement> ::= ROLLBACK [ WORK ] [ AND [ NO ] CHAIN ] [
>> <savepoint clause> ]
>> <savepoint clause> ::= TO SAVEPOINT <savepoint specifier>

Oracle has ROLLBACK TO [ SAVEPOINT ] <savepoint specifier>
DB2 has ROLLBACK TO SAVEPOINT <savepoint specifier>

> 2) We have a different syntax for RELEASE too. The SQL200n draft says:
>
>> <release savepoint statement> ::= RELEASE SAVEPOINT <savepoint specifier>

Oracle does not have RELEASE SAVEPOINT.
DB2 has RELEASE [ TO ] SAVEPOINT <savepoint specifier>

The attached patch implements an approximate union of the above syntaxes:

ROLLBACK [ WORK | TRANSACTION ] TO [ SAVEPOINT ] <savepoint specifier>
RELEASE [ TO ] SAVEPOINT <savepoint specifier>

Note that this means that "RELEASE foo" is no longer valid. It seems
solely a postgresql-ism -- anyone particularly attached to that syntax?

Also in the patch are documentation and regression test updates to
reflect the new syntax. I have changed the examples in the docs and the
regression tests to prefer the standard-conforming variants. Error
messages now refer to ROLLBACK TO SAVEPOINT and RELEASE SAVEPOINT rather
than ROLLBACK TO and RELEASE.

-O

Attachment Content-Type Size
pgsql-server-savepoint-syntax.txt text/plain 25.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2004-08-11 23:54:53 Re: Coming soon: PG 7.4.4, 7.3.7, 7.2.5
Previous Message Tom Lane 2004-08-11 22:08:10 Coming soon: PG 7.4.4, 7.3.7, 7.2.5

Browse pgsql-patches by date

  From Date Subject
Next Message Philip Warner 2004-08-12 00:56:05 Re: pg_dump 'die_on_errors'
Previous Message Tom Lane 2004-08-11 23:29:16 Re: Forwarded mail....