Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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: pgsql-server-savepoint-syntax.txt
Description: text/plain (25.1 KB)

In response to

Responses

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group