mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Back out RESET CONNECTION until there is more discussion.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.83 2006/04/25 14:09:08 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.84 2006/04/25 14:11:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -134,6 +134,7 @@ char *namespace_search_path = NULL;
|
||||
/* Local functions */
|
||||
static void recomputeNamespacePath(void);
|
||||
static void InitTempTableNamespace(void);
|
||||
static void RemoveTempRelations(Oid tempNamespaceId);
|
||||
static void RemoveTempRelationsCallback(int code, Datum arg);
|
||||
static void NamespaceCallback(Datum arg, Oid relid);
|
||||
|
||||
@@ -1728,7 +1729,7 @@ AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid,
|
||||
* in order to clean out any relations that might have been created by
|
||||
* a crashed backend.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
RemoveTempRelations(Oid tempNamespaceId)
|
||||
{
|
||||
ObjectAddress object;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.130 2006/04/25 14:09:10 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.131 2006/04/25 14:11:54 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -127,6 +127,7 @@ static bool unlistenExitRegistered = false;
|
||||
bool Trace_notify = false;
|
||||
|
||||
|
||||
static void Async_UnlistenAll(void);
|
||||
static void Async_UnlistenOnExit(int code, Datum arg);
|
||||
static void ProcessIncomingNotify(void);
|
||||
static void NotifyMyFrontEnd(char *relname, int32 listenerPID);
|
||||
@@ -334,7 +335,7 @@ Async_Unlisten(const char *relname)
|
||||
*
|
||||
*--------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
Async_UnlistenAll(void)
|
||||
{
|
||||
Relation lRel;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2002-2006, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.51 2006/04/25 14:09:11 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.52 2006/04/25 14:11:54 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/memutils.h"
|
||||
|
||||
|
||||
/*
|
||||
* The hash table in which prepared queries are stored. This is
|
||||
* per-backend: query plans are not shared between backends.
|
||||
@@ -546,30 +547,6 @@ DeallocateQuery(DeallocateStmt *stmt)
|
||||
DropPreparedStatement(stmt->name, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove all prepared plans from the backend.
|
||||
*/
|
||||
void
|
||||
DropAllPreparedStatements(void)
|
||||
{
|
||||
PreparedStatement *prep_statement;
|
||||
HASH_SEQ_STATUS status;
|
||||
|
||||
if (!prepared_queries)
|
||||
return;
|
||||
|
||||
hash_seq_init(&status, prepared_queries);
|
||||
|
||||
while ((prep_statement = (PreparedStatement *) hash_seq_search(&status)))
|
||||
{
|
||||
DropDependentPortals(prep_statement->context);
|
||||
|
||||
/* Flush the context holding the subsidiary data */
|
||||
MemoryContextDelete(prep_statement->context);
|
||||
hash_search(prepared_queries, prep_statement->stmt_name, HASH_REMOVE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Internal version of DEALLOCATE
|
||||
*
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.541 2006/04/25 14:09:12 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.542 2006/04/25 14:11:55 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -1244,12 +1244,6 @@ VariableResetStmt:
|
||||
n->name = $2;
|
||||
$$ = (Node *) n;
|
||||
}
|
||||
| RESET CONNECTION
|
||||
{
|
||||
VariableResetStmt *n = makeNode(VariableResetStmt);
|
||||
n->name = "connection";
|
||||
$$ = (Node *) n;
|
||||
}
|
||||
| RESET TIME ZONE
|
||||
{
|
||||
VariableResetStmt *n = makeNode(VariableResetStmt);
|
||||
|
||||
@@ -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