pgsql: Add a new system view, pg_cursors, that displays the currently - Mailing list pgsql-committers

From neilc@postgresql.org (Neil Conway)
Subject pgsql: Add a new system view, pg_cursors, that displays the currently
Date
Msg-id 20060118064930.16D079DC9AD@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Add a new system view, pg_cursors, that displays the currently available
cursors. Patch from Joachim Wieland, review and ediorialization by Neil
Conway. The view lists cursors defined by DECLARE CURSOR, using SPI, or
via the Bind message of the frontend/backend protocol. This means the
view does not list the unnamed portal or the portal created to implement
EXECUTE. Because we do list SPI portals, there might be more rows in
this view than you might expect if you are using SPI implicitly (e.g.
via a procedural language).

Per recent discussion on -hackers, the query string included in the
view for cursors defined by DECLARE CURSOR is based on
debug_query_string. That means it is not accurate if multiple queries
separated by semicolons are submitted as one query string. However,
there doesn't seem a trivial fix for that: debug_query_string
is better than nothing. I also changed SPI_cursor_open() to include
the source text for the portal it creates: AFAICS there is no reason
not to do this.

Update the documentation and regression tests, bump the catversion.

Modified Files:
--------------
    pgsql/doc/src/sgml:
        catalogs.sgml (r2.117 -> r2.118)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/catalogs.sgml.diff?r1=2.117&r2=2.118)
        protocol.sgml (r1.62 -> r1.63)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/protocol.sgml.diff?r1=1.62&r2=1.63)
    pgsql/doc/src/sgml/ref:
        close.sgml (r1.22 -> r1.23)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/close.sgml.diff?r1=1.22&r2=1.23)
        declare.sgml (r1.33 -> r1.34)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/declare.sgml.diff?r1=1.33&r2=1.34)
    pgsql/src/backend/catalog:
        system_views.sql (r1.24 -> r1.25)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/system_views.sql.diff?r1=1.24&r2=1.25)
    pgsql/src/backend/commands:
        portalcmds.c (r1.44 -> r1.45)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/portalcmds.c.diff?r1=1.44&r2=1.45)
        prepare.c (r1.46 -> r1.47)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/prepare.c.diff?r1=1.46&r2=1.47)
    pgsql/src/backend/executor:
        spi.c (r1.145 -> r1.146)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c.diff?r1=1.145&r2=1.146)
    pgsql/src/backend/tcop:
        postgres.c (r1.478 -> r1.479)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c.diff?r1=1.478&r2=1.479)
    pgsql/src/backend/utils/mmgr:
        portalmem.c (r1.83 -> r1.84)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mmgr/portalmem.c.diff?r1=1.83&r2=1.84)
    pgsql/src/include/catalog:
        catversion.h (r1.311 -> r1.312)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h.diff?r1=1.311&r2=1.312)
        pg_proc.h (r1.391 -> r1.392)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_proc.h.diff?r1=1.391&r2=1.392)
    pgsql/src/include/utils:
        builtins.h (r1.270 -> r1.271)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/builtins.h.diff?r1=1.270&r2=1.271)
        portal.h (r1.57 -> r1.58)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/portal.h.diff?r1=1.57&r2=1.58)
    pgsql/src/test/regress/expected:
        portals.out (r1.9 -> r1.10)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/portals.out.diff?r1=1.9&r2=1.10)
        rules.out (r1.112 -> r1.113)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/rules.out.diff?r1=1.112&r2=1.113)
    pgsql/src/test/regress/sql:
        portals.sql (r1.6 -> r1.7)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/portals.sql.diff?r1=1.6&r2=1.7)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix fsync code to test whether F_FULLFSYNC is available, instead
Next
From: dpage@pgfoundry.org (User Dpage)
Date:
Subject: psqlodbc - psqlodbc: Fix line ends