Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
59d591e7
Commit
59d591e7
authored
Apr 25, 2006
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Back out RESET CONNECTION until there is more discussion.
parent
6378fdd9
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
19 additions
and
124 deletions
+19
-124
doc/src/sgml/ref/reset.sgml
doc/src/sgml/ref/reset.sgml
+2
-17
src/backend/catalog/namespace.c
src/backend/catalog/namespace.c
+3
-2
src/backend/commands/async.c
src/backend/commands/async.c
+3
-2
src/backend/commands/prepare.c
src/backend/commands/prepare.c
+2
-25
src/backend/parser/gram.y
src/backend/parser/gram.y
+1
-7
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+2
-31
src/backend/utils/mmgr/portalmem.c
src/backend/utils/mmgr/portalmem.c
+1
-28
src/include/catalog/namespace.h
src/include/catalog/namespace.h
+1
-3
src/include/commands/async.h
src/include/commands/async.h
+1
-2
src/include/commands/prepare.h
src/include/commands/prepare.h
+1
-2
src/include/utils/portal.h
src/include/utils/portal.h
+1
-2
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+1
-3
No files found.
doc/src/sgml/ref/reset.sgml
View file @
59d591e7
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/reset.sgml,v 1.2
7 2006/04/25 14:09:06
momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/reset.sgml,v 1.2
8 2006/04/25 14:11:51
momjian Exp $
PostgreSQL documentation
-->
...
...
@@ -11,8 +11,7 @@ PostgreSQL documentation
<refnamediv>
<refname>RESET</refname>
<refpurpose>restore the value of a run-time parameter to the default value,
or reset all aspects of a session</refpurpose>
<refpurpose>restore the value of a run-time parameter to the default value</refpurpose>
</refnamediv>
<indexterm zone="sql-reset">
...
...
@@ -23,7 +22,6 @@ PostgreSQL documentation
<synopsis>
RESET <replaceable class="PARAMETER">name</replaceable>
RESET ALL
RESET CONNECTION
</synopsis>
</refsynopsisdiv>
...
...
@@ -81,20 +79,7 @@ SET <replaceable class="parameter">parameter</replaceable> TO DEFAULT
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>CONNECTION</literal></term>
<listitem>
<para>
Reset the all aspects of a session, including runtime parameters,
transaction status, temporary tables, <literal>WITH HOLD</literal>
cursors, prepared statements, and <command>LISTEN</command>
registrations.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
...
...
src/backend/catalog/namespace.c
View file @
59d591e7
...
...
@@ -13,7 +13,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.8
3 2006/04/25 14:09:08
momjian Exp $
* $PostgreSQL: pgsql/src/backend/catalog/namespace.c,v 1.8
4 2006/04/25 14:11:53
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -134,6 +134,7 @@ char *namespace_search_path = NULL;
/* Local functions */
static
void
recomputeNamespacePath
(
void
);
static
void
InitTempTableNamespace
(
void
);
static
void
RemoveTempRelations
(
Oid
tempNamespaceId
);
static
void
RemoveTempRelationsCallback
(
int
code
,
Datum
arg
);
static
void
NamespaceCallback
(
Datum
arg
,
Oid
relid
);
...
...
@@ -1728,7 +1729,7 @@ AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid,
* in order to clean out any relations that might have been created by
* a crashed backend.
*/
void
static
void
RemoveTempRelations
(
Oid
tempNamespaceId
)
{
ObjectAddress
object
;
...
...
src/backend/commands/async.c
View file @
59d591e7
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.13
0 2006/04/25 14:09:10
momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.13
1 2006/04/25 14:11:54
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -127,6 +127,7 @@ static bool unlistenExitRegistered = false;
bool
Trace_notify
=
false
;
static
void
Async_UnlistenAll
(
void
);
static
void
Async_UnlistenOnExit
(
int
code
,
Datum
arg
);
static
void
ProcessIncomingNotify
(
void
);
static
void
NotifyMyFrontEnd
(
char
*
relname
,
int32
listenerPID
);
...
...
@@ -334,7 +335,7 @@ Async_Unlisten(const char *relname)
*
*--------------------------------------------------------------
*/
void
static
void
Async_UnlistenAll
(
void
)
{
Relation
lRel
;
...
...
src/backend/commands/prepare.c
View file @
59d591e7
...
...
@@ -10,7 +10,7 @@
* Copyright (c) 2002-2006, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.5
1 2006/04/25 14:09:11
momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.5
2 2006/04/25 14:11:54
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -33,6 +33,7 @@
#include "utils/hsearch.h"
#include "utils/memutils.h"
/*
* The hash table in which prepared queries are stored. This is
* per-backend: query plans are not shared between backends.
...
...
@@ -546,30 +547,6 @@ DeallocateQuery(DeallocateStmt *stmt)
DropPreparedStatement
(
stmt
->
name
,
true
);
}
/*
* Remove all prepared plans from the backend.
*/
void
DropAllPreparedStatements
(
void
)
{
PreparedStatement
*
prep_statement
;
HASH_SEQ_STATUS
status
;
if
(
!
prepared_queries
)
return
;
hash_seq_init
(
&
status
,
prepared_queries
);
while
((
prep_statement
=
(
PreparedStatement
*
)
hash_seq_search
(
&
status
)))
{
DropDependentPortals
(
prep_statement
->
context
);
/* Flush the context holding the subsidiary data */
MemoryContextDelete
(
prep_statement
->
context
);
hash_search
(
prepared_queries
,
prep_statement
->
stmt_name
,
HASH_REMOVE
,
NULL
);
}
}
/*
* Internal version of DEALLOCATE
*
...
...
src/backend/parser/gram.y
View file @
59d591e7
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.54
1 2006/04/25 14:09:12
momjian Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.54
2 2006/04/25 14:11:55
momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -1244,12 +1244,6 @@ VariableResetStmt:
n->name = $2;
$$ = (Node *) n;
}
| RESET CONNECTION
{
VariableResetStmt *n = makeNode(VariableResetStmt);
n->name = "connection";
$$ = (Node *) n;
}
| RESET TIME ZONE
{
VariableResetStmt *n = makeNode(VariableResetStmt);
...
...
src/backend/utils/misc/guc.c
View file @
59d591e7
...
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.31
6 2006/04/25 14:09:15
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.31
7 2006/04/25 14:11:56
momjian Exp $
*
*--------------------------------------------------------------------
*/
...
...
@@ -32,7 +32,6 @@
#include "catalog/namespace.h"
#include "catalog/pg_type.h"
#include "commands/async.h"
#include "commands/prepare.h"
#include "commands/variable.h"
#include "commands/vacuum.h"
#include "executor/executor.h"
...
...
@@ -54,7 +53,6 @@
#include "postmaster/bgwriter.h"
#include "postmaster/syslogger.h"
#include "postmaster/postmaster.h"
#include "storage/backendid.h"
#include "storage/bufmgr.h"
#include "storage/fd.h"
#include "storage/freespace.h"
...
...
@@ -63,13 +61,11 @@
#include "tcop/tcopprot.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/hsearch.h"
#include "utils/memutils.h"
#include "utils/pg_locale.h"
#include "utils/portal.h"
#include "utils/syscache.h"
#include "pgstat.h"
#ifndef PG_KRB_SRVTAB
#define PG_KRB_SRVTAB ""
#endif
...
...
@@ -4653,33 +4649,8 @@ GetPGVariableResultDesc(const char *name)
void
ResetPGVariable
(
const
char
*
name
)
{
char
namespaceName
[
NAMEDATALEN
];
Oid
namespaceId
;
if
(
pg_strcasecmp
(
name
,
"all"
)
==
0
)
/* resetting all GUC variables */
ResetAllOptions
();
else
if
(
pg_strcasecmp
(
name
,
"connection"
)
==
0
)
{
ResetAllOptions
();
/* Clean temp-tables */
snprintf
(
namespaceName
,
sizeof
(
namespaceName
),
"pg_temp_%d"
,
MyBackendId
);
namespaceId
=
GetSysCacheOid
(
NAMESPACENAME
,
CStringGetDatum
(
namespaceName
),
0
,
0
,
0
);
RemoveTempRelations
(
namespaceId
);
DropAllPreparedStatements
();
Async_UnlistenAll
();
/* Delete cursors, including WITH HOLD */
PortalHashTableDeleteAll
();
if
(
IsTransactionBlock
())
UserAbortTransactionBlock
();
}
else
set_config_option
(
name
,
NULL
,
...
...
src/backend/utils/mmgr/portalmem.c
View file @
59d591e7
...
...
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.8
6 2006/04/25 14:09:16
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.8
7 2006/04/25 14:11:58
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -402,9 +402,6 @@ DropDependentPortals(MemoryContext queryContext)
HASH_SEQ_STATUS
status
;
PortalHashEnt
*
hentry
;
if
(
PortalHashTable
==
NULL
)
return
;
hash_seq_init
(
&
status
,
PortalHashTable
);
while
((
hentry
=
(
PortalHashEnt
*
)
hash_seq_search
(
&
status
))
!=
NULL
)
...
...
@@ -416,30 +413,6 @@ DropDependentPortals(MemoryContext queryContext)
}
}
/*
* Delete all WITH HOLD cursors, used by RESET CONNECTION
*/
void
PortalHashTableDeleteAll
(
void
)
{
HASH_SEQ_STATUS
status
;
PortalHashEnt
*
hentry
;
if
(
PortalHashTable
==
NULL
)
return
;
hash_seq_init
(
&
status
,
PortalHashTable
);
while
((
hentry
=
(
PortalHashEnt
*
)
hash_seq_search
(
&
status
))
!=
NULL
)
{
Portal
portal
=
hentry
->
portal
;
if
((
portal
->
cursorOptions
&
CURSOR_OPT_HOLD
)
&&
portal
->
status
!=
PORTAL_ACTIVE
)
PortalDrop
(
portal
,
false
);
}
}
/*
* Pre-commit processing for portals.
...
...
src/include/catalog/namespace.h
View file @
59d591e7
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.4
0 2006/04/25 14:09:16
momjian Exp $
* $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.4
1 2006/04/25 14:11:59
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -74,8 +74,6 @@ extern void PopSpecialNamespace(Oid namespaceId);
extern
Oid
FindConversionByName
(
List
*
conname
);
extern
Oid
FindDefaultConversionProc
(
int4
for_encoding
,
int4
to_encoding
);
extern
void
RemoveTempRelations
(
Oid
tempNamespaceId
);
/* initialization & transaction cleanup code */
extern
void
InitializeSearchPath
(
void
);
extern
void
AtEOXact_Namespace
(
bool
isCommit
);
...
...
src/include/commands/async.h
View file @
59d591e7
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/commands/async.h,v 1.3
2 2006/04/25 14:09:17
momjian Exp $
* $PostgreSQL: pgsql/src/include/commands/async.h,v 1.3
3 2006/04/25 14:11:59
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -19,7 +19,6 @@ extern bool Trace_notify;
extern
void
Async_Notify
(
const
char
*
relname
);
extern
void
Async_Listen
(
const
char
*
relname
);
extern
void
Async_Unlisten
(
const
char
*
relname
);
extern
void
Async_UnlistenAll
(
void
);
/* perform (or cancel) outbound notify processing at transaction commit */
extern
void
AtCommit_Notify
(
void
);
...
...
src/include/commands/prepare.h
View file @
59d591e7
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 2002-2006, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/commands/prepare.h,v 1.
19 2006/04/25 14:09:18
momjian Exp $
* $PostgreSQL: pgsql/src/include/commands/prepare.h,v 1.
20 2006/04/25 14:11:59
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -62,7 +62,6 @@ extern void StorePreparedStatement(const char *stmt_name,
extern
PreparedStatement
*
FetchPreparedStatement
(
const
char
*
stmt_name
,
bool
throwError
);
extern
void
DropPreparedStatement
(
const
char
*
stmt_name
,
bool
showError
);
extern
void
DropAllPreparedStatements
(
void
);
extern
List
*
FetchPreparedStatementParams
(
const
char
*
stmt_name
);
extern
TupleDesc
FetchPreparedStatementResultDesc
(
PreparedStatement
*
stmt
);
extern
bool
PreparedStatementReturnsTuples
(
PreparedStatement
*
stmt
);
...
...
src/include/utils/portal.h
View file @
59d591e7
...
...
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/utils/portal.h,v 1.6
0 2006/04/25 14:09:1
9 momjian Exp $
* $PostgreSQL: pgsql/src/include/utils/portal.h,v 1.6
1 2006/04/25 14:11:5
9 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -200,7 +200,6 @@ extern void AtSubAbort_Portals(SubTransactionId mySubid,
extern
void
AtSubCleanup_Portals
(
SubTransactionId
mySubid
);
extern
Portal
CreatePortal
(
const
char
*
name
,
bool
allowDup
,
bool
dupSilent
);
extern
Portal
CreateNewPortal
(
void
);
extern
void
PortalHashTableDeleteAll
(
void
);
extern
void
PortalDrop
(
Portal
portal
,
bool
isTopCommit
);
extern
void
DropDependentPortals
(
MemoryContext
queryContext
);
extern
Portal
GetPortalByName
(
const
char
*
name
);
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
59d591e7
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.32
2 2006/04/25 14:09:21
momjian Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.32
3 2006/04/25 14:11:59
momjian Exp $ */
/* Copyright comment */
%{
...
...
@@ -1196,8 +1196,6 @@ VariableResetStmt: RESET var_name
{ $$ = make_str("reset transaction isolation level"); }
| RESET SESSION AUTHORIZATION
{ $$ = make_str("reset session authorization"); }
| RESET CONNECTION
{ $$ = make_str("reset connection"); }
| RESET ALL
{ $$ = make_str("reset all"); }
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment