diff options
author | Neil Conway <neilc@samurai.com> | 2007-04-26 16:13:15 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2007-04-26 16:13:15 +0000 |
commit | 16efdb5ec7f28bed9541fc773330e3e2ebe2ed9a (patch) | |
tree | 6ec0d0c7b08584ef53bf340e4d71a156e9655eba /src/backend/tcop/utility.c | |
parent | 5ea27a4b2812d148f2516d130aee9dbaba45cedc (diff) | |
download | postgresql-16efdb5ec7f28bed9541fc773330e3e2ebe2ed9a.tar.gz postgresql-16efdb5ec7f28bed9541fc773330e3e2ebe2ed9a.zip |
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/tcop/utility.c')
-rw-r--r-- | src/backend/tcop/utility.c | 39 |
1 files changed, 24 insertions, 15 deletions
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; |