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

Rename the newly-added commands for discarding session state.

RESET SESSION, RESET PLANS, and RESET TEMP are now DISCARD ALL,
DISCARD PLANS, and DISCARD TEMP, respectively. This is to avoid
confusion with the pre-existing RESET variants: the DISCARD
commands are not actually similar to RESET. Patch from Marko
Kreen, with some minor editorialization.
This commit is contained in:
Neil Conway
2007-04-26 16:13:15 +00:00
parent 5ea27a4b28
commit 16efdb5ec7
19 changed files with 345 additions and 133 deletions

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.589 2007/04/16 01:14:56 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.590 2007/04/26 16:13:11 neilc Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -158,7 +158,7 @@ static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args, List *args)
CreateOpFamilyStmt AlterOpFamilyStmt CreatePLangStmt
CreateSchemaStmt CreateSeqStmt CreateStmt CreateTableSpaceStmt
CreateAssertStmt CreateTrigStmt CreateUserStmt CreateRoleStmt
CreatedbStmt DeclareCursorStmt DefineStmt DeleteStmt
CreatedbStmt DeclareCursorStmt DefineStmt DeleteStmt DiscardStmt
DropGroupStmt DropOpClassStmt DropOpFamilyStmt DropPLangStmt DropStmt
DropAssertStmt DropTrigStmt DropRuleStmt DropCastStmt DropRoleStmt
DropUserStmt DropdbStmt DropTableSpaceStmt ExplainStmt FetchStmt
@@ -382,7 +382,7 @@ static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args, List *args)
DATABASE DAY_P DEALLOCATE DEC DECIMAL_P DECLARE DEFAULT DEFAULTS
DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS
DESC DISABLE_P DISTINCT DO DOCUMENT_P DOMAIN_P DOUBLE_P DROP
DESC DISABLE_P DISCARD DISTINCT DO DOCUMENT_P DOMAIN_P DOUBLE_P DROP
EACH ELSE ENABLE_P ENCODING ENCRYPTED END_P ENUM_P ESCAPE EXCEPT EXCLUDING
EXCLUSIVE EXECUTE EXISTS EXPLAIN EXTERNAL EXTRACT
@@ -416,7 +416,7 @@ static Node *makeXmlExpr(XmlExprOp op, char *name, List *named_args, List *args)
OBJECT_P OF OFF OFFSET OIDS OLD ON ONLY OPERATOR OPTION OR
ORDER OUT_P OUTER_P OVERLAPS OVERLAY OWNED OWNER
PARTIAL PASSWORD PLACING POSITION
PARTIAL PASSWORD PLACING PLANS POSITION
PRECISION PRESERVE PREPARE PREPARED PRIMARY
PRIOR PRIVILEGES PROCEDURAL PROCEDURE
@@ -569,6 +569,7 @@ stmt :
| DeclareCursorStmt
| DefineStmt
| DeleteStmt
| DiscardStmt
| DropAssertStmt
| DropCastStmt
| DropGroupStmt
@@ -1328,6 +1329,40 @@ CheckPointStmt:
;
/*****************************************************************************
*
* DISCARD { ALL | TEMP | PLANS }
*
*****************************************************************************/
DiscardStmt:
DISCARD ALL
{
DiscardStmt *n = makeNode(DiscardStmt);
n->target = DISCARD_ALL;
$$ = (Node *) n;
}
| DISCARD TEMP
{
DiscardStmt *n = makeNode(DiscardStmt);
n->target = DISCARD_TEMP;
$$ = (Node *) n;
}
| DISCARD TEMPORARY
{
DiscardStmt *n = makeNode(DiscardStmt);
n->target = DISCARD_TEMP;
$$ = (Node *) n;
}
| DISCARD PLANS
{
DiscardStmt *n = makeNode(DiscardStmt);
n->target = DISCARD_PLANS;
$$ = (Node *) n;
}
;
/*****************************************************************************
*
* ALTER [ TABLE | INDEX ] variations
@@ -8796,6 +8831,7 @@ unreserved_keyword:
| DELIMITER
| DELIMITERS
| DISABLE_P
| DISCARD
| DOCUMENT_P
| DOMAIN_P
| DOUBLE_P
@@ -8881,6 +8917,7 @@ unreserved_keyword:
| OWNER
| PARTIAL
| PASSWORD
| PLANS
| PREPARE
| PREPARED
| PRESERVE

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.186 2007/04/02 03:49:38 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.187 2007/04/26 16:13:12 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -124,6 +124,7 @@ static const ScanKeyword ScanKeywords[] = {
{"delimiters", DELIMITERS},
{"desc", DESC},
{"disable", DISABLE_P},
{"discard", DISCARD},
{"distinct", DISTINCT},
{"do", DO},
{"document", DOCUMENT_P},
@@ -269,6 +270,7 @@ static const ScanKeyword ScanKeywords[] = {
{"partial", PARTIAL},
{"password", PASSWORD},
{"placing", PLACING},
{"plans", PLANS},
{"position", POSITION},
{"precision", PRECISION},
{"prepare", PREPARE},