OSDN Git Service

Add a new system view, pg_prepared_statements, that can be used to
authorNeil Conway <neilc@samurai.com>
Sun, 8 Jan 2006 07:00:27 +0000 (07:00 +0000)
committerNeil Conway <neilc@samurai.com>
Sun, 8 Jan 2006 07:00:27 +0000 (07:00 +0000)
commit44b928e876b06ba6801ec2c60d2cd914a2185c5d
treee15760f3f86aae4f3e782954b699444e2a1f4bc0
parentafa8f1971ae57b4d5091f77717f666d365545867
Add a new system view, pg_prepared_statements, that can be used to
access information about the prepared statements that are available
in the current session. Original patch from Joachim Wieland, various
improvements by Neil Conway.

The "statement" column of the view contains the literal query string
sent by the client, without any rewriting or pretty printing. This
means that prepared statements created via SQL will be prefixed with
"PREPARE ... AS ", whereas those prepared via the FE/BE protocol will
not. That is unfortunate, but discussion on -patches did not yield an
efficient way to improve this, and there is some merit in returning
exactly what the client sent to the backend.

Catalog version bumped, regression tests updated.
13 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/ref/prepare.sgml
src/backend/catalog/system_views.sql
src/backend/commands/prepare.c
src/backend/tcop/postgres.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_type.h
src/include/commands/prepare.h
src/include/utils/builtins.h
src/test/regress/expected/prepare.out
src/test/regress/expected/rules.out
src/test/regress/sql/prepare.sql