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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-patches by date

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