From d13e903beaecd45a3721e4c2a7f9ff842ce94a79 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Thu, 12 Apr 2007 06:53:49 +0000 Subject: 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. --- src/backend/utils/cache/plancache.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/backend/utils/cache') diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c index f02a58e29b..6165e59c6e 100644 --- a/src/backend/utils/cache/plancache.c +++ b/src/backend/utils/cache/plancache.c @@ -33,7 +33,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.5 2007/03/26 00:36:19 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/plancache.c,v 1.6 2007/04/12 06:53:47 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -880,6 +880,15 @@ PlanCacheCallback(Datum arg, Oid relid) } } +/* + * ResetPlanCache: drop all cached plans. + */ +void +ResetPlanCache(void) +{ + PlanCacheCallback((Datum) 0, InvalidOid); +} + /* * ScanQueryForRelids callback function for PlanCacheCallback */ -- cgit v1.2.1