On Thu, 2007-04-12 at 11:45 -0400, Alvaro Herrera wrote:
> This phrase is missing a verb:
> [...]
> I find this markup strange:
> [...]
> In ResetTempTableNamespace(void), shouldn't it be using myTempNamespace
> instead of the SysCache lookup?
All fair points: I've applied the attached patch. Thanks for the review.
-Neil
Index: doc/src/sgml/ref/reset.sgml
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/doc/src/sgml/ref/reset.sgml,v
retrieving revision 1.33
diff -c -p -r1.33 reset.sgml
*** doc/src/sgml/ref/reset.sgml 12 Apr 2007 06:53:46 -0000 1.33
--- doc/src/sgml/ref/reset.sgml 12 Apr 2007 22:28:39 -0000
*************** SET <replaceable class="parameter">confi
*** 42,48 ****
<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
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
--- 42,48 ----
<para>
The default value is defined as the value that the parameter would
! 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
*************** SET <replaceable class="parameter">confi
*** 112,118 ****
Releases all temporary resources associated with the current
session. This has the same effect as executing the following
command sequence:
! <synopsis>
SET SESSION AUTHORIZATION DEFAULT;
RESET ALL;
DEALLOCATE ALL;
--- 112,118 ----
Releases all temporary resources associated with the current
session. This has the same effect as executing the following
command sequence:
! <programlisting>
SET SESSION AUTHORIZATION DEFAULT;
RESET ALL;
DEALLOCATE ALL;
*************** CLOSE ALL;
*** 120,126 ****
UNLISTEN *;
RESET PLANS;
RESET TEMP;
! </synopsis>
</para>
</listitem>
</varlistentry>
--- 120,126 ----
UNLISTEN *;
RESET PLANS;
RESET TEMP;
! </programlisting>
</para>
</listitem>
</varlistentry>
Index: src/backend/catalog/namespace.c
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/backend/catalog/namespace.c,v
retrieving revision 1.94
diff -c -p -r1.94 namespace.c
*** src/backend/catalog/namespace.c 12 Apr 2007 06:53:46 -0000 1.94
--- src/backend/catalog/namespace.c 12 Apr 2007 22:24:18 -0000
*************** InitTempTableNamespace(void)
*** 1946,1963 ****
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);
}
/*
--- 1946,1953 ----
void
ResetTempTableNamespace(void)
{
! if (OidIsValid(myTempNamespace))
! RemoveTempRelations(myTempNamespace);
}
/*
Index: src/include/catalog/namespace.h
===================================================================
RCS file: /home/neilc/postgres/cvs_root/pgsql/src/include/catalog/namespace.h,v
retrieving revision 1.46
diff -c -p -r1.46 namespace.h
*** src/include/catalog/namespace.h 12 Apr 2007 06:53:48 -0000 1.46
--- src/include/catalog/namespace.h 12 Apr 2007 22:34:08 -0000
*************** extern char *NameListToQuotedString(List
*** 81,86 ****
--- 81,87 ----
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);
*************** extern char *namespace_search_path;
*** 100,105 ****
extern List *fetch_search_path(bool includeImplicit);
- extern void ResetTempTableNamespace(void);
-
#endif /* NAMESPACE_H */
--- 101,104 ----
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq