1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

Add RESET CONNECTION, to reset all aspects of a session.

Hans-J?rgen Sch?nig
This commit is contained in:
Bruce Momjian
2006-04-25 14:09:21 +00:00
parent 11fbdf2f25
commit 6378fdd971
12 changed files with 128 additions and 20 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.129 2006/03/05 15:58:23 momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.130 2006/04/25 14:09:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -127,7 +127,6 @@ 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);
@@ -335,7 +334,7 @@ Async_Unlisten(const char *relname)
*
*--------------------------------------------------------------
*/
static void
void
Async_UnlistenAll(void)
{
Relation lRel;

View File

@@ -10,7 +10,7 @@
* Copyright (c) 2002-2006, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.50 2006/04/22 01:25:58 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.51 2006/04/25 14:09:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -33,7 +33,6 @@
#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.
@@ -547,6 +546,30 @@ 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
*