aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2007-04-12 06:53:49 +0000
committerNeil Conway <neilc@samurai.com>2007-04-12 06:53:49 +0000
commitd13e903beaecd45a3721e4c2a7f9ff842ce94a79 (patch)
tree3ded6910c6f451bb982fb5033735afd24927c5b6 /src/include
parente6e47f278d2ab0fc744b56fed86cc34299079037 (diff)
downloadpostgresql-d13e903beaecd45a3721e4c2a7f9ff842ce94a79.tar.gz
postgresql-d13e903beaecd45a3721e4c2a7f9ff842ce94a79.zip
RESET SESSION, plus related new DDL commands. Patch from Marko Kreen,
reviewed by Neil Conway. This patch adds the following DDL command variants: RESET SESSION, RESET TEMP, RESET PLANS, CLOSE ALL, and DEALLOCATE ALL. RESET SESSION is intended for use by connection pool software and the like, in order to reset a client session to something close to its initial state. Note that while most of these command variants can be executed inside a transaction block (but are not transaction-aware!), RESET SESSION cannot. While this is inconsistent, it is intended to catch programmer mistakes: RESET SESSION in an open transaction block is probably unintended.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/namespace.h4
-rw-r--r--src/include/commands/async.h3
-rw-r--r--src/include/commands/prepare.h4
-rw-r--r--src/include/nodes/parsenodes.h4
-rw-r--r--src/include/utils/guc.h4
-rw-r--r--src/include/utils/plancache.h4
-rw-r--r--src/include/utils/portal.h3
7 files changed, 18 insertions, 8 deletions
diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h
index 18e3157b9e3..456d22f942c 100644
--- a/src/include/catalog/namespace.h
+++ b/src/include/catalog/namespace.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.45 2007/03/23 19:53:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.46 2007/04/12 06:53:48 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -100,4 +100,6 @@ extern char *namespace_search_path;
extern List *fetch_search_path(bool includeImplicit);
+extern void ResetTempTableNamespace(void);
+
#endif /* NAMESPACE_H */
diff --git a/src/include/commands/async.h b/src/include/commands/async.h
index a97abf7dd93..c6a84a0133b 100644
--- a/src/include/commands/async.h
+++ b/src/include/commands/async.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/async.h,v 1.34 2007/01/05 22:19:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/commands/async.h,v 1.35 2007/04/12 06:53:48 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -19,6 +19,7 @@ extern bool Trace_notify;
extern void Async_Notify(const char *relname);
extern void Async_Listen(const char *relname);
extern void Async_Unlisten(const char *relname);
+extern void Async_UnlistenAll(void);
/* perform (or cancel) outbound notify processing at transaction commit */
extern void AtCommit_Notify(void);
diff --git a/src/include/commands/prepare.h b/src/include/commands/prepare.h
index 4e27ab3bb39..c12d248971e 100644
--- a/src/include/commands/prepare.h
+++ b/src/include/commands/prepare.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 2002-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/commands/prepare.h,v 1.25 2007/03/13 00:33:43 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/commands/prepare.h,v 1.26 2007/04/12 06:53:48 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -59,4 +59,6 @@ extern void DropPreparedStatement(const char *stmt_name, bool showError);
extern TupleDesc FetchPreparedStatementResultDesc(PreparedStatement *stmt);
extern List *FetchPreparedStatementTargetList(PreparedStatement *stmt);
+void DropAllPreparedStatements(void);
+
#endif /* PREPARE_H */
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 8552620be3c..bc421e265fc 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.344 2007/04/02 03:49:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.345 2007/04/12 06:53:48 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1451,6 +1451,7 @@ typedef struct ClosePortalStmt
{
NodeTag type;
char *portalname; /* name of the portal (cursor) */
+ /* NULL means CLOSE ALL */
} ClosePortalStmt;
/* ----------------------
@@ -1981,6 +1982,7 @@ typedef struct DeallocateStmt
{
NodeTag type;
char *name; /* The name of the plan to remove */
+ /* NULL means DEALLOCATE ALL */
} DeallocateStmt;
/*
diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h
index 3efb8618938..e3315c72257 100644
--- a/src/include/utils/guc.h
+++ b/src/include/utils/guc.h
@@ -7,7 +7,7 @@
* Copyright (c) 2000-2007, PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
- * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.80 2007/03/06 02:06:15 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/utils/guc.h,v 1.81 2007/04/12 06:53:48 neilc Exp $
*--------------------------------------------------------------------
*/
#ifndef GUC_H
@@ -201,7 +201,7 @@ extern int GetNumConfigOptions(void);
extern void SetPGVariable(const char *name, List *args, bool is_local);
extern void GetPGVariable(const char *name, DestReceiver *dest);
extern TupleDesc GetPGVariableResultDesc(const char *name);
-extern void ResetPGVariable(const char *name);
+extern void ResetPGVariable(const char *name, bool isTopLevel);
extern char *flatten_set_variable_args(const char *name, List *args);
diff --git a/src/include/utils/plancache.h b/src/include/utils/plancache.h
index e193238291d..562b369044f 100644
--- a/src/include/utils/plancache.h
+++ b/src/include/utils/plancache.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/plancache.h,v 1.4 2007/03/23 19:53:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/plancache.h,v 1.5 2007/04/12 06:53:48 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -105,4 +105,6 @@ extern void ReleaseCachedPlan(CachedPlan *plan, bool useResOwner);
extern TupleDesc PlanCacheComputeResultDesc(List *stmt_list);
extern bool HaveCachedPlans(void);
+extern void ResetPlanCache(void);
+
#endif /* PLANCACHE_H */
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h
index 47651006a21..4c31e2a121f 100644
--- a/src/include/utils/portal.h
+++ b/src/include/utils/portal.h
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/portal.h,v 1.74 2007/03/13 00:33:43 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/portal.h,v 1.75 2007/04/12 06:53:48 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -212,5 +212,6 @@ extern void PortalDefineQuery(Portal portal,
CachedPlan *cplan);
extern Node *PortalListGetPrimaryStmt(List *stmts);
extern void PortalCreateHoldStore(Portal portal);
+extern void PortalHashTableDeleteAll(void);
#endif /* PORTAL_H */