1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Allow optional SAVEPOINT keyword in RELEASE and ROLLBACK TO, for greater

compliance with SQL2003 spec syntax.

Oliver Jowett
This commit is contained in:
Tom Lane
2004-08-12 19:12:21 +00:00
parent 10249abfa1
commit a583675108
8 changed files with 118 additions and 94 deletions

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.469 2004/08/02 04:26:35 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.470 2004/08/12 19:12:21 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -3982,6 +3982,14 @@ TransactionStmt:
(Node *)makeString($2)));
$$ = (Node *)n;
}
| RELEASE SAVEPOINT ColId
{
TransactionStmt *n = makeNode(TransactionStmt);
n->kind = TRANS_STMT_RELEASE;
n->options = list_make1(makeDefElem("savepoint_name",
(Node *)makeString($3)));
$$ = (Node *)n;
}
| RELEASE ColId
{
TransactionStmt *n = makeNode(TransactionStmt);
@@ -3990,12 +3998,20 @@ TransactionStmt:
(Node *)makeString($2)));
$$ = (Node *)n;
}
| ROLLBACK TO ColId
| ROLLBACK opt_transaction TO SAVEPOINT ColId
{
TransactionStmt *n = makeNode(TransactionStmt);
n->kind = TRANS_STMT_ROLLBACK_TO;
n->options = list_make1(makeDefElem("savepoint_name",
(Node *)makeString($3)));
(Node *)makeString($5)));
$$ = (Node *)n;
}
| ROLLBACK opt_transaction TO ColId
{
TransactionStmt *n = makeNode(TransactionStmt);
n->kind = TRANS_STMT_ROLLBACK_TO;
n->options = list_make1(makeDefElem("savepoint_name",
(Node *)makeString($4)));
$$ = (Node *)n;
}
;