diff options
author | Neil Conway | 2007-04-12 22:34:45 +0000 |
---|---|---|
committer | Neil Conway | 2007-04-12 22:34:45 +0000 |
commit | 6df6d8e36104003c7a4e4724278809011a871bd2 (patch) | |
tree | 32ebafdfda8d86b9a02a140056eb190ab4c889b8 | |
parent | c0e42e9325949a692d0803331e60ae87d2f76684 (diff) |
Fixes for RESET SESSION patch, per Alvaro. Fix a typo in the RESET
ref page (sorry, my fault!), and simplify the coding of
ResetTempTableNamespace().
-rw-r--r-- | doc/src/sgml/ref/reset.sgml | 8 | ||||
-rw-r--r-- | src/backend/catalog/namespace.c | 16 | ||||
-rw-r--r-- | src/include/catalog/namespace.h | 5 |
3 files changed, 9 insertions, 20 deletions
diff --git a/doc/src/sgml/ref/reset.sgml b/doc/src/sgml/ref/reset.sgml index e94ef0b8d5..e98f7ff56c 100644 --- a/doc/src/sgml/ref/reset.sgml +++ b/doc/src/sgml/ref/reset.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/reset.sgml,v 1.33 2007/04/12 06:53:46 neilc Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/reset.sgml,v 1.34 2007/04/12 22:34:45 neilc Exp $ PostgreSQL documentation --> @@ -42,7 +42,7 @@ SET <replaceable class="parameter">configuration_parameter</replaceable> TO DEFA <para> The default value is defined as the value that the parameter would - have had, if no <command>SET</> ever been issued for it in the + have had, if no <command>SET</> had ever been issued for it in the current session. The actual source of this value might be a compiled-in default, the configuration file, command-line options, or per-database or per-user default settings. See <xref @@ -112,7 +112,7 @@ SET <replaceable class="parameter">configuration_parameter</replaceable> TO DEFA Releases all temporary resources associated with the current session. This has the same effect as executing the following command sequence: -<synopsis> +<programlisting> SET SESSION AUTHORIZATION DEFAULT; RESET ALL; DEALLOCATE ALL; @@ -120,7 +120,7 @@ CLOSE ALL; UNLISTEN *; RESET PLANS; RESET TEMP; -</synopsis> +</programlisting> </para> </listitem> </varlistentry> diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index 16853b3d79..ca51b997c0 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -13,7 +13,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.94 2007/04/12 06:53:46 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.95 2007/04/12 22:34:45 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -1946,18 +1946,8 @@ InitTempTableNamespace(void) void ResetTempTableNamespace(void) { - char namespaceName[NAMEDATALEN]; - Oid namespaceId; - - /* find oid */ - snprintf(namespaceName, sizeof(namespaceName), "pg_temp_%d", MyBackendId); - namespaceId = GetSysCacheOid(NAMESPACENAME, - CStringGetDatum(namespaceName), - 0, 0, 0); - - /* clean if exists */ - if (OidIsValid(namespaceId)) - RemoveTempRelations(namespaceId); + if (OidIsValid(myTempNamespace)) + RemoveTempRelations(myTempNamespace); } /* diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h index 456d22f942..0050c122a7 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.46 2007/04/12 06:53:48 neilc Exp $ + * $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.47 2007/04/12 22:34:45 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -81,6 +81,7 @@ extern char *NameListToQuotedString(List *names); extern bool isTempNamespace(Oid namespaceId); extern bool isAnyTempNamespace(Oid namespaceId); extern bool isOtherTempNamespace(Oid namespaceId); +extern void ResetTempTableNamespace(void); extern OverrideSearchPath *GetOverrideSearchPath(MemoryContext context); extern void PushOverrideSearchPath(OverrideSearchPath *newpath); @@ -100,6 +101,4 @@ extern char *namespace_search_path; extern List *fetch_search_path(bool includeImplicit); -extern void ResetTempTableNamespace(void); - #endif /* NAMESPACE_H */ |