Skip site navigation (1) Skip section navigation (2)

Re: patch to create system view that lists cursors

From: Neil Conway <neilc(at)samurai(dot)com>
To: Joachim Wieland <joe(at)mcknight(dot)de>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: patch to create system view that lists cursors
Date: 2006-01-12 22:39:39
Message-ID: 1137105579.9143.159.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-patches
On Thu, 2006-01-12 at 10:51 +0100, Joachim Wieland wrote:
> Attached is a patch to create a new system view pg_cursors to list all
> available cursors to the current session and transaction.

+ /* loop until we find a named portal or hit the end of the list */
+ while ((hentry = hash_seq_search(hash_seq)) != NULL)
+ {
+     portal = hentry->portal;
+     /* there can be a named portal created by CreateNewPortal, its
name
+      * will be "<unnamed portal n>" (see CreateNewPortal function in
this
+      * file). Those have a status of PORTAL_NEW. The status of cursors
is
+      * PORTAL_READY however. */
+     if (portal->status != PORTAL_READY)
+         continue;
+     if (portal->name[0] != '\0')
+         break;
+ }

I think it is worth distinguishing more clearly between portals that
should be displayed to the user and those that should not (which might
be labelled "internal cursors", perhaps). The tests above seem fairly
ad-hoc.

Barring any objections, I'll implement the above and apply the revised
patch tomorrow.

-Neil



In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2006-01-13 00:27:57
Subject: Re: patch to create system view that lists cursors
Previous:From: Neil ConwayDate: 2006-01-12 22:33:04
Subject: Re: mbutils.c memory cxt cleanup

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group