Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59d591e

Browse files
committed
Back out RESET CONNECTION until there is more discussion.
1 parent6378fdd commit59d591e

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
staticvoidrecomputeNamespacePath(void);
136136
staticvoidInitTempTableNamespace(void);
137+
staticvoidRemoveTempRelations(OidtempNamespaceId);
137138
staticvoidRemoveTempRelationsCallback(intcode,Datumarg);
138139
staticvoidNamespaceCallback(Datumarg,Oidrelid);
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+
staticvoid
17321733
RemoveTempRelations(OidtempNamespaceId)
17331734
{
17341735
ObjectAddressobject;

‎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
boolTrace_notify= false;
128128

129129

130+
staticvoidAsync_UnlistenAll(void);
130131
staticvoidAsync_UnlistenOnExit(intcode,Datumarg);
131132
staticvoidProcessIncomingNotify(void);
132133
staticvoidNotifyMyFrontEnd(char*relname,int32listenerPID);
@@ -334,7 +335,7 @@ Async_Unlisten(const char *relname)
334335
*
335336
*--------------------------------------------------------------
336337
*/
337-
void
338+
staticvoid
338339
Async_UnlistenAll(void)
339340
{
340341
RelationlRel;

‎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_STATUSstatus;
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
* AUTHORDATEMAJOR EVENT
@@ -1244,12 +1244,6 @@ VariableResetStmt:
12441244
n->name =$2;
12451245
$$ = (Node *) n;
12461246
}
1247-
|RESETCONNECTION
1248-
{
1249-
VariableResetStmt *n = makeNode(VariableResetStmt);
1250-
n->name ="connection";
1251-
$$ = (Node *) n;
1252-
}
12531247
|RESETTIMEZONE
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
#ifndefPG_KRB_SRVTAB
7470
#definePG_KRB_SRVTAB ""
7571
#endif
@@ -4653,33 +4649,8 @@ GetPGVariableResultDesc(const char *name)
46534649
void
46544650
ResetPGVariable(constchar*name)
46554651
{
4656-
charnamespaceName[NAMEDATALEN];
4657-
OidnamespaceId;
4658-
46594652
if (pg_strcasecmp(name,"all")==0)
4660-
/* resetting all GUC variables */
46614653
ResetAllOptions();
4662-
elseif(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_STATUSstatus;
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_STATUSstatus;
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-
Portalportal=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
externOidFindConversionByName(List*conname);
7575
externOidFindDefaultConversionProc(int4for_encoding,int4to_encoding);
7676

77-
externvoidRemoveTempRelations(OidtempNamespaceId);
78-
7977
/* initialization & transaction cleanup code */
8078
externvoidInitializeSearchPath(void);
8179
externvoidAtEOXact_Namespace(boolisCommit);

‎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
externvoidAsync_Notify(constchar*relname);
2020
externvoidAsync_Listen(constchar*relname);
2121
externvoidAsync_Unlisten(constchar*relname);
22-
externvoidAsync_UnlistenAll(void);
2322

2423
/* perform (or cancel) outbound notify processing at transaction commit */
2524
externvoidAtCommit_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
externPreparedStatement*FetchPreparedStatement(constchar*stmt_name,
6363
boolthrowError);
6464
externvoidDropPreparedStatement(constchar*stmt_name,boolshowError);
65-
externvoidDropAllPreparedStatements(void);
6665
externList*FetchPreparedStatementParams(constchar*stmt_name);
6766
externTupleDescFetchPreparedStatementResultDesc(PreparedStatement*stmt);
6867
externboolPreparedStatementReturnsTuples(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
externvoidAtSubCleanup_Portals(SubTransactionIdmySubid);
201201
externPortalCreatePortal(constchar*name,boolallowDup,booldupSilent);
202202
externPortalCreateNewPortal(void);
203-
externvoidPortalHashTableDeleteAll(void);
204203
externvoidPortalDrop(Portalportal,boolisTopCommit);
205204
externvoidDropDependentPortals(MemoryContextqueryContext);
206205
externPortalGetPortalByName(constchar*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
|RESETSESSIONAUTHORIZATION
11981198
{$$ = make_str("reset session authorization"); }
1199-
|RESETCONNECTION
1200-
{$$ = make_str("reset connection"); }
12011199
|RESETALL
12021200
{$$ = make_str("reset all"); }
12031201
;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp