1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +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

@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.388 2007/04/22 03:52:40 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.389 2007/04/26 16:13:12 neilc Exp $
*
*--------------------------------------------------------------------
*/
@@ -5047,30 +5047,6 @@ GetPGVariableResultDesc(const char *name)
return tupdesc;
}
/*
* RESET SESSION command.
*/
static void
ResetSession(bool isTopLevel)
{
/*
* Disallow RESET SESSION in a transaction block. This is arguably
* inconsistent (we don't make a similar check in the command
* sequence that RESET SESSION is equivalent to), but the idea is
* to catch mistakes: RESET SESSION inside a transaction block
* would leave the transaction still uncommitted.
*/
PreventTransactionChain(isTopLevel, "RESET SESSION");
SetPGVariable("session_authorization", NIL, false);
ResetAllOptions();
DropAllPreparedStatements();
PortalHashTableDeleteAll();
Async_UnlistenAll();
ResetPlanCache();
ResetTempTableNamespace();
}
/*
* RESET command
*/
@@ -5079,13 +5055,6 @@ ResetPGVariable(const char *name, bool isTopLevel)
{
if (pg_strcasecmp(name, "all") == 0)
ResetAllOptions();
else if (pg_strcasecmp(name, "session") == 0)
ResetSession(isTopLevel);
else if (pg_strcasecmp(name, "temp") == 0 ||
pg_strcasecmp(name, "temporary") == 0)
ResetTempTableNamespace();
else if (pg_strcasecmp(name, "plans") == 0)
ResetPlanCache();
else
set_config_option(name,
NULL,