diff options
author | Neil Conway | 2007-04-26 16:13:15 +0000 |
---|---|---|
committer | Neil Conway | 2007-04-26 16:13:15 +0000 |
commit | 16efdb5ec7f28bed9541fc773330e3e2ebe2ed9a (patch) | |
tree | 6ec0d0c7b08584ef53bf340e4d71a156e9655eba /src/backend/parser | |
parent | 5ea27a4b2812d148f2516d130aee9dbaba45cedc (diff) |
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.
Diffstat (limited to 'src/backend/parser')
-rw-r--r-- | src/backend/parser/gram.y | 45 | ||||
-rw-r--r-- | src/backend/parser/keywords.c | 4 |
2 files changed, 44 insertions, 5 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index b9728deaada..a69e6989a94 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -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 @@ -1330,6 +1331,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 diff --git a/src/backend/parser/keywords.c b/src/backend/parser/keywords.c index 9f6cf1e20e4..5c8ef10a214 100644 --- a/src/backend/parser/keywords.c +++ b/src/backend/parser/keywords.c @@ -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}, |