SAVEPOINT syntax again

Поиск
Список
Период
Сортировка
Искать

SAVEPOINT syntax again

От:
Oliver Jowett <oliver@opencloud.com>
Дата:
Against CVS HEAD:

> test=# select version();
>                                             version                                            
> -----------------------------------------------------------------------------------------------
>  PostgreSQL 8.0.0beta1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3 (Debian 20040401)
> (1 row)
> 
> test=# begin;
> BEGIN
> test=# savepoint foo;
> SAVEPOINT
> test=# rollback to foo;
> ROLLBACK
> test=# rollback to savepoint foo;
> ERROR:  syntax error at or near "foo" at character 23
> LINE 1: rollback to savepoint foo;
>                               ^
> test=# rollback;
> ROLLBACK

> test=# begin;
> BEGIN
> test=# savepoint foo;
> SAVEPOINT
> test=# release foo;
> RELEASE
> test=# savepoint foo;
> SAVEPOINT
> test=# release savepoint foo;
> ERROR:  syntax error at or near "foo" at character 19
> LINE 1: release savepoint foo;
>                           ^

Comments:

1) We have a different syntax to the SQL200n draft (and Oracle by the 
looks of it) for ROLLBACK. The draft says:

>  ::= ROLLBACK [ WORK ] [ AND [ NO ] CHAIN ] [  ]
>  ::= TO SAVEPOINT 

2) We have a different syntax for RELEASE too. The SQL200n draft says:

>  ::= RELEASE SAVEPOINT 

3) Can the command tag for a ROLLBACK TO SAVEPOINT be different to the 
command tag for a global rollback, so clients can distinguish the two 
cases? ("ROLLBACK " might be nice)

-O

FAQ