Skip to content

Commit 59d591e

Browse files
committed
Back out RESET CONNECTION until there is more discussion.
1 parent 6378fdd commit 59d591e

File tree

12 files changed

+19
-124
lines changed

12 files changed

+19
-124
lines changed

doc/src/sgml/ref/reset.sgml

Lines changed: 2 additions & 17 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.27 2006/04/25 14:09:06 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/reset.sgml,v 1.28 2006/04/25 14:11:51 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -11,8 +11,7 @@ PostgreSQL documentation
1111

1212
<refnamediv>
1313
<refname>RESET</refname>
14-
<refpurpose>restore the value of a run-time parameter to the default value,
15-
or reset all aspects of a session</refpurpose>
14+
<refpurpose>restore the value of a run-time parameter to the default value</refpurpose>
1615
</refnamediv>
1716

1817
<indexterm zone="sql-reset">
@@ -23,7 +22,6 @@ PostgreSQL documentation
2322
<synopsis>
2423
RESET <replaceable class="PARAMETER">name</replaceable>
2524
RESET ALL
26-
RESET CONNECTION
2725
</synopsis>
2826
</refsynopsisdiv>
2927

@@ -81,20 +79,7 @@ SET <replaceable class="parameter">parameter</replaceable> TO DEFAULT
8179
</para>
8280
</listitem>
8381
</varlistentry>
84-
85-
<varlistentry>
86-
<term><literal>CONNECTION</literal></term>
87-
<listitem>
88-
<para>
89-
Reset the all aspects of a session, including runtime parameters,
90-
transaction status, temporary tables, <literal>WITH HOLD</literal>
91-
cursors, prepared statements, and <command>LISTEN</command>
92-
registrations.
93-
</para>
94-
</listitem>
95-
</varlistentry>
9682
</variablelist>
97-
9883
</refsect1>
9984

10085
<refsect1>

src/backend/catalog/namespace.c

Lines changed: 3 additions & 2 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.83 2006/04/25 14:09:08 momjian Exp $
16+
* $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.84 2006/04/25 14:11:53 momjian Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -134,6 +134,7 @@ char *namespace_search_path = NULL;
134134
/* Local functions */
135135
static void recomputeNamespacePath(void);
136136
static void InitTempTableNamespace(void);
137+
static void RemoveTempRelations(Oid tempNamespaceId);
137138
static void RemoveTempRelationsCallback(int code, Datum arg);
138139
static void NamespaceCallback(Datum arg, Oid relid);
139140

@@ -1728,7 +1729,7 @@ AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid,
17281729
* in order to clean out any relations that might have been created by
17291730
* a crashed backend.
17301731
*/
1731-
void
1732+
static void
17321733
RemoveTempRelations(Oid tempNamespaceId)
17331734
{
17341735
ObjectAddress object;

src/backend/commands/async.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.130 2006/04/25 14:09:10 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.131 2006/04/25 14:11:54 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -127,6 +127,7 @@ static bool unlistenExitRegistered = false;
127127
bool Trace_notify = false;
128128

129129

130+
static void Async_UnlistenAll(void);
130131
static void Async_UnlistenOnExit(int code, Datum arg);
131132
static void ProcessIncomingNotify(void);
132133
static void NotifyMyFrontEnd(char *relname, int32 listenerPID);
@@ -334,7 +335,7 @@ Async_Unlisten(const char *relname)
334335
*
335336
*--------------------------------------------------------------
336337
*/
337-
void
338+
static void
338339
Async_UnlistenAll(void)
339340
{
340341
Relation lRel;

src/backend/commands/prepare.c

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Copyright (c) 2002-2006, PostgreSQL Global Development Group
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.51 2006/04/25 14:09:11 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.52 2006/04/25 14:11:54 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -33,6 +33,7 @@
3333
#include "utils/hsearch.h"
3434
#include "utils/memutils.h"
3535

36+
3637
/*
3738
* The hash table in which prepared queries are stored. This is
3839
* per-backend: query plans are not shared between backends.
@@ -546,30 +547,6 @@ DeallocateQuery(DeallocateStmt *stmt)
546547
DropPreparedStatement(stmt->name, true);
547548
}
548549

549-
/*
550-
* Remove all prepared plans from the backend.
551-
*/
552-
void
553-
DropAllPreparedStatements(void)
554-
{
555-
PreparedStatement *prep_statement;
556-
HASH_SEQ_STATUS status;
557-
558-
if (!prepared_queries)
559-
return;
560-
561-
hash_seq_init(&status, prepared_queries);
562-
563-
while ((prep_statement = (PreparedStatement *) hash_seq_search(&status)))
564-
{
565-
DropDependentPortals(prep_statement->context);
566-
567-
/* Flush the context holding the subsidiary data */
568-
MemoryContextDelete(prep_statement->context);
569-
hash_search(prepared_queries, prep_statement->stmt_name, HASH_REMOVE, NULL);
570-
}
571-
}
572-
573550
/*
574551
* Internal version of DEALLOCATE
575552
*

src/backend/parser/gram.y

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.541 2006/04/25 14:09:12 momjian Exp $
14+
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.542 2006/04/25 14:11:55 momjian Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -1244,12 +1244,6 @@ VariableResetStmt:
12441244
n->name = $2;
12451245
$$ = (Node *) n;
12461246
}
1247-
| RESET CONNECTION
1248-
{
1249-
VariableResetStmt *n = makeNode(VariableResetStmt);
1250-
n->name = "connection";
1251-
$$ = (Node *) n;
1252-
}
12531247
| RESET TIME ZONE
12541248
{
12551249
VariableResetStmt *n = makeNode(VariableResetStmt);

src/backend/utils/misc/guc.c

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.316 2006/04/25 14:09:15 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.317 2006/04/25 14:11:56 momjian Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -32,7 +32,6 @@
3232
#include "catalog/namespace.h"
3333
#include "catalog/pg_type.h"
3434
#include "commands/async.h"
35-
#include "commands/prepare.h"
3635
#include "commands/variable.h"
3736
#include "commands/vacuum.h"
3837
#include "executor/executor.h"
@@ -54,7 +53,6 @@
5453
#include "postmaster/bgwriter.h"
5554
#include "postmaster/syslogger.h"
5655
#include "postmaster/postmaster.h"
57-
#include "storage/backendid.h"
5856
#include "storage/bufmgr.h"
5957
#include "storage/fd.h"
6058
#include "storage/freespace.h"
@@ -63,13 +61,11 @@
6361
#include "tcop/tcopprot.h"
6462
#include "utils/array.h"
6563
#include "utils/builtins.h"
66-
#include "utils/hsearch.h"
6764
#include "utils/memutils.h"
6865
#include "utils/pg_locale.h"
69-
#include "utils/portal.h"
70-
#include "utils/syscache.h"
7166
#include "pgstat.h"
7267

68+
7369
#ifndef PG_KRB_SRVTAB
7470
#define PG_KRB_SRVTAB ""
7571
#endif
@@ -4653,33 +4649,8 @@ GetPGVariableResultDesc(const char *name)
46534649
void
46544650
ResetPGVariable(const char *name)
46554651
{
4656-
char namespaceName[NAMEDATALEN];
4657-
Oid namespaceId;
4658-
46594652
if (pg_strcasecmp(name, "all") == 0)
4660-
/* resetting all GUC variables */
46614653
ResetAllOptions();
4662-
else if (pg_strcasecmp(name, "connection") == 0)
4663-
{
4664-
ResetAllOptions();
4665-
4666-
/* Clean temp-tables */
4667-
snprintf(namespaceName, sizeof(namespaceName), "pg_temp_%d",
4668-
MyBackendId);
4669-
namespaceId = GetSysCacheOid(NAMESPACENAME,
4670-
CStringGetDatum(namespaceName), 0, 0, 0);
4671-
RemoveTempRelations(namespaceId);
4672-
4673-
DropAllPreparedStatements();
4674-
4675-
Async_UnlistenAll();
4676-
4677-
/* Delete cursors, including WITH HOLD */
4678-
PortalHashTableDeleteAll();
4679-
4680-
if (IsTransactionBlock())
4681-
UserAbortTransactionBlock();
4682-
}
46834654
else
46844655
set_config_option(name,
46854656
NULL,

src/backend/utils/mmgr/portalmem.c

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.86 2006/04/25 14:09:16 momjian Exp $
15+
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.87 2006/04/25 14:11:58 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -402,9 +402,6 @@ DropDependentPortals(MemoryContext queryContext)
402402
HASH_SEQ_STATUS status;
403403
PortalHashEnt *hentry;
404404

405-
if (PortalHashTable == NULL)
406-
return;
407-
408405
hash_seq_init(&status, PortalHashTable);
409406

410407
while ((hentry = (PortalHashEnt *) hash_seq_search(&status)) != NULL)
@@ -416,30 +413,6 @@ DropDependentPortals(MemoryContext queryContext)
416413
}
417414
}
418415

419-
/*
420-
* Delete all WITH HOLD cursors, used by RESET CONNECTION
421-
*/
422-
void
423-
PortalHashTableDeleteAll(void)
424-
{
425-
HASH_SEQ_STATUS status;
426-
PortalHashEnt *hentry;
427-
428-
if (PortalHashTable == NULL)
429-
return;
430-
431-
hash_seq_init(&status, PortalHashTable);
432-
433-
while ((hentry = (PortalHashEnt *) hash_seq_search(&status)) != NULL)
434-
{
435-
Portal portal = hentry->portal;
436-
437-
if ((portal->cursorOptions & CURSOR_OPT_HOLD) &&
438-
portal->status != PORTAL_ACTIVE)
439-
PortalDrop(portal, false);
440-
}
441-
}
442-
443416

444417
/*
445418
* Pre-commit processing for portals.

src/include/catalog/namespace.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2006, 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.40 2006/04/25 14:09:16 momjian Exp $
10+
* $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.41 2006/04/25 14:11:59 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -74,8 +74,6 @@ extern void PopSpecialNamespace(Oid namespaceId);
7474
extern Oid FindConversionByName(List *conname);
7575
extern Oid FindDefaultConversionProc(int4 for_encoding, int4 to_encoding);
7676

77-
extern void RemoveTempRelations(Oid tempNamespaceId);
78-
7977
/* initialization & transaction cleanup code */
8078
extern void InitializeSearchPath(void);
8179
extern void AtEOXact_Namespace(bool isCommit);

src/include/commands/async.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/commands/async.h,v 1.32 2006/04/25 14:09:17 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/commands/async.h,v 1.33 2006/04/25 14:11:59 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -19,7 +19,6 @@ extern bool Trace_notify;
1919
extern void Async_Notify(const char *relname);
2020
extern void Async_Listen(const char *relname);
2121
extern void Async_Unlisten(const char *relname);
22-
extern void Async_UnlistenAll(void);
2322

2423
/* perform (or cancel) outbound notify processing at transaction commit */
2524
extern void AtCommit_Notify(void);

src/include/commands/prepare.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 2002-2006, PostgreSQL Global Development Group
88
*
9-
* $PostgreSQL: pgsql/src/include/commands/prepare.h,v 1.19 2006/04/25 14:09:18 momjian Exp $
9+
* $PostgreSQL: pgsql/src/include/commands/prepare.h,v 1.20 2006/04/25 14:11:59 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -62,7 +62,6 @@ extern void StorePreparedStatement(const char *stmt_name,
6262
extern PreparedStatement *FetchPreparedStatement(const char *stmt_name,
6363
bool throwError);
6464
extern void DropPreparedStatement(const char *stmt_name, bool showError);
65-
extern void DropAllPreparedStatements(void);
6665
extern List *FetchPreparedStatementParams(const char *stmt_name);
6766
extern TupleDesc FetchPreparedStatementResultDesc(PreparedStatement *stmt);
6867
extern bool PreparedStatementReturnsTuples(PreparedStatement *stmt);

src/include/utils/portal.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
4040
* Portions Copyright (c) 1994, Regents of the University of California
4141
*
42-
* $PostgreSQL: pgsql/src/include/utils/portal.h,v 1.60 2006/04/25 14:09:19 momjian Exp $
42+
* $PostgreSQL: pgsql/src/include/utils/portal.h,v 1.61 2006/04/25 14:11:59 momjian Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -200,7 +200,6 @@ extern void AtSubAbort_Portals(SubTransactionId mySubid,
200200
extern void AtSubCleanup_Portals(SubTransactionId mySubid);
201201
extern Portal CreatePortal(const char *name, bool allowDup, bool dupSilent);
202202
extern Portal CreateNewPortal(void);
203-
extern void PortalHashTableDeleteAll(void);
204203
extern void PortalDrop(Portal portal, bool isTopCommit);
205204
extern void DropDependentPortals(MemoryContext queryContext);
206205
extern Portal GetPortalByName(const char *name);

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.322 2006/04/25 14:09:21 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.323 2006/04/25 14:11:59 momjian Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -1196,8 +1196,6 @@ VariableResetStmt: RESET var_name
11961196
{ $$ = make_str("reset transaction isolation level"); }
11971197
| RESET SESSION AUTHORIZATION
11981198
{ $$ = make_str("reset session authorization"); }
1199-
| RESET CONNECTION
1200-
{ $$ = make_str("reset connection"); }
12011199
| RESET ALL
12021200
{ $$ = make_str("reset all"); }
12031201
;

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