From 16efdb5ec7f28bed9541fc773330e3e2ebe2ed9a Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Thu, 26 Apr 2007 16:13:15 +0000 Subject: 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. --- src/backend/tcop/utility.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'src/backend/tcop/utility.c') diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 88adb625d55..9dd700ffe70 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.277 2007/04/12 06:53:47 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.278 2007/04/26 16:13:12 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -29,6 +29,7 @@ #include "commands/copy.h" #include "commands/dbcommands.h" #include "commands/defrem.h" +#include "commands/discard.h" #include "commands/explain.h" #include "commands/lockcmds.h" #include "commands/portalcmds.h" @@ -604,10 +605,7 @@ ProcessUtility(Node *parsetree, break; case OBJECT_DOMAIN: - - /* - * RemoveDomain does its own permissions checks - */ + /* RemoveDomain does its own permissions checks */ RemoveDomain(names, stmt->behavior, stmt->missing_ok); break; @@ -618,10 +616,7 @@ ProcessUtility(Node *parsetree, break; case OBJECT_SCHEMA: - - /* - * RemoveSchema does its own permissions checks - */ + /* RemoveSchema does its own permissions checks */ RemoveSchema(names, stmt->behavior, stmt->missing_ok); break; @@ -994,6 +989,10 @@ ProcessUtility(Node *parsetree, } break; + case T_DiscardStmt: + DiscardCommand((DiscardStmt *) parsetree, isTopLevel); + break; + case T_CreateTrigStmt: CreateTrigger((CreateTrigStmt *) parsetree, InvalidOid); break; @@ -1752,12 +1751,22 @@ CreateCommandTag(Node *parsetree) break; case T_VariableResetStmt: - { - VariableResetStmt *stmt = (VariableResetStmt *) parsetree; - if (pg_strcasecmp(stmt->name, "session") == 0) - tag = "RESET SESSION"; - else - tag = "RESET"; + tag = "RESET"; + break; + + case T_DiscardStmt: + switch (((DiscardStmt *) parsetree)->target) { + case DISCARD_ALL: + tag = "DISCARD ALL"; + break; + case DISCARD_PLANS: + tag = "DISCARD PLANS"; + break; + case DISCARD_TEMP: + tag = "DISCARD TEMP"; + break; + default: + tag = "???"; } break; -- cgit v1.2.3