mirror of
https://github.com/postgres/postgres.git
synced 2025-12-02 23:42:46 +03:00
Back out RESET CONNECTION until there is more discussion.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.316 2006/04/25 14:09:15 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.317 2006/04/25 14:11:56 momjian Exp $
|
||||
*
|
||||
*--------------------------------------------------------------------
|
||||
*/
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "catalog/namespace.h"
|
||||
#include "catalog/pg_type.h"
|
||||
#include "commands/async.h"
|
||||
#include "commands/prepare.h"
|
||||
#include "commands/variable.h"
|
||||
#include "commands/vacuum.h"
|
||||
#include "executor/executor.h"
|
||||
@@ -54,7 +53,6 @@
|
||||
#include "postmaster/bgwriter.h"
|
||||
#include "postmaster/syslogger.h"
|
||||
#include "postmaster/postmaster.h"
|
||||
#include "storage/backendid.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "storage/fd.h"
|
||||
#include "storage/freespace.h"
|
||||
@@ -63,13 +61,11 @@
|
||||
#include "tcop/tcopprot.h"
|
||||
#include "utils/array.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/memutils.h"
|
||||
#include "utils/pg_locale.h"
|
||||
#include "utils/portal.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "pgstat.h"
|
||||
|
||||
|
||||
#ifndef PG_KRB_SRVTAB
|
||||
#define PG_KRB_SRVTAB ""
|
||||
#endif
|
||||
@@ -4653,33 +4649,8 @@ GetPGVariableResultDesc(const char *name)
|
||||
void
|
||||
ResetPGVariable(const char *name)
|
||||
{
|
||||
char namespaceName[NAMEDATALEN];
|
||||
Oid namespaceId;
|
||||
|
||||
if (pg_strcasecmp(name, "all") == 0)
|
||||
/* resetting all GUC variables */
|
||||
ResetAllOptions();
|
||||
else if (pg_strcasecmp(name, "connection") == 0)
|
||||
{
|
||||
ResetAllOptions();
|
||||
|
||||
/* Clean temp-tables */
|
||||
snprintf(namespaceName, sizeof(namespaceName), "pg_temp_%d",
|
||||
MyBackendId);
|
||||
namespaceId = GetSysCacheOid(NAMESPACENAME,
|
||||
CStringGetDatum(namespaceName), 0, 0, 0);
|
||||
RemoveTempRelations(namespaceId);
|
||||
|
||||
DropAllPreparedStatements();
|
||||
|
||||
Async_UnlistenAll();
|
||||
|
||||
/* Delete cursors, including WITH HOLD */
|
||||
PortalHashTableDeleteAll();
|
||||
|
||||
if (IsTransactionBlock())
|
||||
UserAbortTransactionBlock();
|
||||
}
|
||||
else
|
||||
set_config_option(name,
|
||||
NULL,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.86 2006/04/25 14:09:16 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.87 2006/04/25 14:11:58 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -402,9 +402,6 @@ DropDependentPortals(MemoryContext queryContext)
|
||||
HASH_SEQ_STATUS status;
|
||||
PortalHashEnt *hentry;
|
||||
|
||||
if (PortalHashTable == NULL)
|
||||
return;
|
||||
|
||||
hash_seq_init(&status, PortalHashTable);
|
||||
|
||||
while ((hentry = (PortalHashEnt *) hash_seq_search(&status)) != NULL)
|
||||
@@ -416,30 +413,6 @@ DropDependentPortals(MemoryContext queryContext)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete all WITH HOLD cursors, used by RESET CONNECTION
|
||||
*/
|
||||
void
|
||||
PortalHashTableDeleteAll(void)
|
||||
{
|
||||
HASH_SEQ_STATUS status;
|
||||
PortalHashEnt *hentry;
|
||||
|
||||
if (PortalHashTable == NULL)
|
||||
return;
|
||||
|
||||
hash_seq_init(&status, PortalHashTable);
|
||||
|
||||
while ((hentry = (PortalHashEnt *) hash_seq_search(&status)) != NULL)
|
||||
{
|
||||
Portal portal = hentry->portal;
|
||||
|
||||
if ((portal->cursorOptions & CURSOR_OPT_HOLD) &&
|
||||
portal->status != PORTAL_ACTIVE)
|
||||
PortalDrop(portal, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Pre-commit processing for portals.
|
||||
|
||||
Reference in New Issue
Block a user