Skip to content

Commit 6df6d8e

Browse files
author
Neil Conway
committed
Fixes for RESET SESSION patch, per Alvaro. Fix a typo in the RESET
ref page (sorry, my fault!), and simplify the coding of ResetTempTableNamespace().
1 parent c0e42e9 commit 6df6d8e

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

doc/src/sgml/ref/reset.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/reset.sgml,v 1.33 2007/04/12 06:53:46 neilc Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/reset.sgml,v 1.34 2007/04/12 22:34:45 neilc Exp $
33
PostgreSQL documentation
44
-->
55

@@ -42,7 +42,7 @@ SET <replaceable class="parameter">configuration_parameter</replaceable> TO DEFA
4242

4343
<para>
4444
The default value is defined as the value that the parameter would
45-
have had, if no <command>SET</> ever been issued for it in the
45+
have had, if no <command>SET</> had ever been issued for it in the
4646
current session. The actual source of this value might be a
4747
compiled-in default, the configuration file, command-line options,
4848
or per-database or per-user default settings. See <xref
@@ -112,15 +112,15 @@ SET <replaceable class="parameter">configuration_parameter</replaceable> TO DEFA
112112
Releases all temporary resources associated with the current
113113
session. This has the same effect as executing the following
114114
command sequence:
115-
<synopsis>
115+
<programlisting>
116116
SET SESSION AUTHORIZATION DEFAULT;
117117
RESET ALL;
118118
DEALLOCATE ALL;
119119
CLOSE ALL;
120120
UNLISTEN *;
121121
RESET PLANS;
122122
RESET TEMP;
123-
</synopsis>
123+
</programlisting>
124124
</para>
125125
</listitem>
126126
</varlistentry>

src/backend/catalog/namespace.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
1515
* IDENTIFICATION
16-
* $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.94 2007/04/12 06:53:46 neilc Exp $
16+
* $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.95 2007/04/12 22:34:45 neilc Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -1946,18 +1946,8 @@ InitTempTableNamespace(void)
19461946
void
19471947
ResetTempTableNamespace(void)
19481948
{
1949-
char namespaceName[NAMEDATALEN];
1950-
Oid namespaceId;
1951-
1952-
/* find oid */
1953-
snprintf(namespaceName, sizeof(namespaceName), "pg_temp_%d", MyBackendId);
1954-
namespaceId = GetSysCacheOid(NAMESPACENAME,
1955-
CStringGetDatum(namespaceName),
1956-
0, 0, 0);
1957-
1958-
/* clean if exists */
1959-
if (OidIsValid(namespaceId))
1960-
RemoveTempRelations(namespaceId);
1949+
if (OidIsValid(myTempNamespace))
1950+
RemoveTempRelations(myTempNamespace);
19611951
}
19621952

19631953
/*

src/include/catalog/namespace.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.46 2007/04/12 06:53:48 neilc Exp $
10+
* $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.47 2007/04/12 22:34:45 neilc Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -81,6 +81,7 @@ extern char *NameListToQuotedString(List *names);
8181
extern bool isTempNamespace(Oid namespaceId);
8282
extern bool isAnyTempNamespace(Oid namespaceId);
8383
extern bool isOtherTempNamespace(Oid namespaceId);
84+
extern void ResetTempTableNamespace(void);
8485

8586
extern OverrideSearchPath *GetOverrideSearchPath(MemoryContext context);
8687
extern void PushOverrideSearchPath(OverrideSearchPath *newpath);
@@ -100,6 +101,4 @@ extern char *namespace_search_path;
100101

101102
extern List *fetch_search_path(bool includeImplicit);
102103

103-
extern void ResetTempTableNamespace(void);
104-
105104
#endif /* NAMESPACE_H */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy