mirror of
https://github.com/postgres/postgres.git
synced 2025-12-01 12:18:01 +03:00
Add RESET CONNECTION, to reset all aspects of a session.
Hans-J?rgen Sch?nig
This commit is contained in:
@@ -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.85 2006/03/05 15:58:49 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.86 2006/04/25 14:09:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -402,6 +402,9 @@ 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)
|
||||
@@ -413,6 +416,30 @@ 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.
|
||||
|
||||
Reference in New Issue
Block a user