mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Change the parameter_types column of the pg_prepared_statements to be
an array of regtype, rather than an array of OIDs. This is likely to be more useful to user, and the type OID can easily be obtained by casting a regtype value to OID. Per suggestion from Tom. Update the documentation and regression tests, and bump the catversion.
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
<!--
|
<!--
|
||||||
Documentation of the system catalogs, directed toward PostgreSQL developers
|
Documentation of the system catalogs, directed toward PostgreSQL developers
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.116 2006/01/08 07:00:24 neilc Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.117 2006/01/16 18:15:30 neilc Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="catalogs">
|
<chapter id="catalogs">
|
||||||
@ -284,8 +284,8 @@
|
|||||||
<entry>
|
<entry>
|
||||||
The initial value of the transition state. This is a text
|
The initial value of the transition state. This is a text
|
||||||
field containing the initial value in its external string
|
field containing the initial value in its external string
|
||||||
representation. If this field is null, the transition state
|
representation. If this field is NULL, the transition state
|
||||||
value starts out null.
|
value starts out NULL.
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -293,10 +293,11 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
New aggregate functions are registered with the <command>CREATE
|
New aggregate functions are registered with the <xref
|
||||||
AGGREGATE</command> command. See <xref linkend="xaggr"> for more
|
linkend="sql-createaggregate" endterm="sql-createaggregate-title">
|
||||||
information about writing aggregate functions and the meaning of
|
command. See <xref linkend="xaggr"> for more information about
|
||||||
the transition functions, etc.
|
writing aggregate functions and the meaning of the transition
|
||||||
|
functions, etc.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
@ -1018,7 +1019,7 @@
|
|||||||
<entry><type>bool</type></entry>
|
<entry><type>bool</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Role may log in, that is, this role can be given as the initial
|
Role may log in. That is, this role can be given as the initial
|
||||||
session authorization identifier.
|
session authorization identifier.
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
@ -1561,21 +1562,21 @@
|
|||||||
<entry><structfield>relukeys</structfield></entry>
|
<entry><structfield>relukeys</structfield></entry>
|
||||||
<entry><type>int2</type></entry>
|
<entry><type>int2</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>unused (<emphasis>not</emphasis> the number of unique keys)</entry>
|
<entry>Unused (<emphasis>not</emphasis> the number of unique keys)</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><structfield>relfkeys</structfield></entry>
|
<entry><structfield>relfkeys</structfield></entry>
|
||||||
<entry><type>int2</type></entry>
|
<entry><type>int2</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>unused (<emphasis>not</emphasis> the number of foreign keys on the table)</entry>
|
<entry>Unused (<emphasis>not</emphasis> the number of foreign keys on the table)</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><structfield>relrefs</structfield></entry>
|
<entry><structfield>relrefs</structfield></entry>
|
||||||
<entry><type>int2</type></entry>
|
<entry><type>int2</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>unused</entry>
|
<entry>Unused</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -1583,7 +1584,7 @@
|
|||||||
<entry><type>bool</type></entry>
|
<entry><type>bool</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
True if we generate an OID for each row of the relation.
|
True if we generate an OID for each row of the relation
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -1592,7 +1593,7 @@
|
|||||||
<entry><type>bool</type></entry>
|
<entry><type>bool</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
True if the table has (or once had) a primary key.
|
True if the table has (or once had) a primary key
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -1601,7 +1602,7 @@
|
|||||||
<entry><type>bool</type></entry>
|
<entry><type>bool</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>True if table has rules; see
|
<entry>True if table has rules; see
|
||||||
<structname>pg_rewrite</structname> catalog.
|
<structname>pg_rewrite</structname> catalog
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -1609,7 +1610,7 @@
|
|||||||
<entry><structfield>relhassubclass</structfield></entry>
|
<entry><structfield>relhassubclass</structfield></entry>
|
||||||
<entry><type>bool</type></entry>
|
<entry><type>bool</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>True if table has (or once had) any inheritance children.</entry>
|
<entry>True if table has (or once had) any inheritance children</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -1620,7 +1621,7 @@
|
|||||||
Access privileges; see
|
Access privileges; see
|
||||||
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
||||||
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
||||||
for details.
|
for details
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -2030,7 +2031,7 @@
|
|||||||
Access privileges; see
|
Access privileges; see
|
||||||
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
||||||
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
||||||
for details.
|
for details
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -2131,7 +2132,7 @@
|
|||||||
<entry><type>char</type></entry>
|
<entry><type>char</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
A code defining the specific semantics of this dependency relationship; see text.
|
A code defining the specific semantics of this dependency relationship; see text
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -2273,7 +2274,7 @@
|
|||||||
<entry><structfield>description</structfield></entry>
|
<entry><structfield>description</structfield></entry>
|
||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>Arbitrary text that serves as the description of this object.</entry>
|
<entry>Arbitrary text that serves as the description of this object</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@ -2335,7 +2336,7 @@
|
|||||||
<entry><structfield>indisunique</structfield></entry>
|
<entry><structfield>indisunique</structfield></entry>
|
||||||
<entry><type>bool</type></entry>
|
<entry><type>bool</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>If true, this is a unique index.</entry>
|
<entry>If true, this is a unique index</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -2350,7 +2351,7 @@
|
|||||||
<entry><structfield>indisclustered</structfield></entry>
|
<entry><structfield>indisclustered</structfield></entry>
|
||||||
<entry><type>bool</type></entry>
|
<entry><type>bool</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>If true, the table was last clustered on this index.</entry>
|
<entry>If true, the table was last clustered on this index</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -2385,7 +2386,7 @@
|
|||||||
<entry>Expression trees (in <function>nodeToString()</function> representation)
|
<entry>Expression trees (in <function>nodeToString()</function> representation)
|
||||||
for index attributes that are not simple column references. This is a
|
for index attributes that are not simple column references. This is a
|
||||||
list with one element for each zero entry in <structfield>indkey</>.
|
list with one element for each zero entry in <structfield>indkey</>.
|
||||||
Null if all index attributes are simple references.</entry>
|
NULL if all index attributes are simple references.</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -2393,7 +2394,7 @@
|
|||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>Expression tree (in <function>nodeToString()</function> representation)
|
<entry>Expression tree (in <function>nodeToString()</function> representation)
|
||||||
for partial index predicate. Null if not a partial index.</entry>
|
for partial index predicate. NULL if not a partial index.</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@ -2435,7 +2436,7 @@
|
|||||||
<entry><type>oid</type></entry>
|
<entry><type>oid</type></entry>
|
||||||
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
||||||
<entry>
|
<entry>
|
||||||
The OID of the child table.
|
The OID of the child table
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -2444,7 +2445,7 @@
|
|||||||
<entry><type>oid</type></entry>
|
<entry><type>oid</type></entry>
|
||||||
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
||||||
<entry>
|
<entry>
|
||||||
The OID of the parent table.
|
The OID of the parent table
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -2556,7 +2557,7 @@
|
|||||||
Access privileges; see
|
Access privileges; see
|
||||||
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
||||||
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
||||||
for details.
|
for details
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -2683,7 +2684,7 @@
|
|||||||
<entry><structfield>listenerpid</structfield></entry>
|
<entry><structfield>listenerpid</structfield></entry>
|
||||||
<entry><type>int4</type></entry>
|
<entry><type>int4</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>PID of the server process that created this entry.</entry>
|
<entry>PID of the server process that created this entry</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -2752,7 +2753,7 @@
|
|||||||
Access privileges; see
|
Access privileges; see
|
||||||
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
||||||
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
||||||
for details.
|
for details
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -3030,8 +3031,8 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Unused column contain zeroes, for example <structfield>oprleft</structfield> is zero for a
|
Unused column contain zeroes. For example, <structfield>oprleft</structfield>
|
||||||
prefix operator.
|
is zero for a prefix operator.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
@ -3123,9 +3124,10 @@
|
|||||||
<para>
|
<para>
|
||||||
There are not currently any commands that manipulate procedural language
|
There are not currently any commands that manipulate procedural language
|
||||||
templates; to change the built-in information, a superuser must modify
|
templates; to change the built-in information, a superuser must modify
|
||||||
the table using ordinary INSERT, DELETE, or UPDATE commands. It is
|
the table using ordinary <command>INSERT</command>, <command>DELETE</command>,
|
||||||
likely that a future release of <productname>PostgreSQL</productname>
|
or <command>UPDATE</command> commands. It is likely that a future
|
||||||
will offer commands to change the entries in a cleaner fashion.
|
release of <productname>PostgreSQL</productname> will offer
|
||||||
|
commands to change the entries in a cleaner fashion.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -3349,7 +3351,7 @@
|
|||||||
Access privileges; see
|
Access privileges; see
|
||||||
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
||||||
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
||||||
for details.
|
for details
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -3552,7 +3554,7 @@
|
|||||||
<entry><type>char</type></entry>
|
<entry><type>char</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
A code defining the specific semantics of this dependency relationship; see text.
|
A code defining the specific semantics of this dependency relationship; see text
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -3743,8 +3745,8 @@
|
|||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Numerical statistics of the appropriate kind for the
|
Numerical statistics of the appropriate kind for the
|
||||||
<replaceable>N</>th <quote>slot</quote>, or null if the slot
|
<replaceable>N</>th <quote>slot</quote>, or NULL if the slot
|
||||||
kind does not involve numerical values.
|
kind does not involve numerical values
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -3754,7 +3756,7 @@
|
|||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Column data values of the appropriate kind for the
|
Column data values of the appropriate kind for the
|
||||||
<replaceable>N</>th <quote>slot</quote>, or null if the slot
|
<replaceable>N</>th <quote>slot</quote>, or NULL if the slot
|
||||||
kind does not store any data values. Each array's element
|
kind does not store any data values. Each array's element
|
||||||
values are actually of the specific column's data type, so there
|
values are actually of the specific column's data type, so there
|
||||||
is no way to define these columns' type more specifically than
|
is no way to define these columns' type more specifically than
|
||||||
@ -3831,7 +3833,7 @@
|
|||||||
Access privileges; see
|
Access privileges; see
|
||||||
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
<xref linkend="sql-grant" endterm="sql-grant-title"> and
|
||||||
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
<xref linkend="sql-revoke" endterm="sql-revoke-title">
|
||||||
for details.
|
for details
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -3955,7 +3957,7 @@
|
|||||||
<entry><structfield>tgargs</structfield></entry>
|
<entry><structfield>tgargs</structfield></entry>
|
||||||
<entry><type>bytea</type></entry>
|
<entry><type>bytea</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>Argument strings to pass to trigger, each null-terminated</entry>
|
<entry>Argument strings to pass to trigger, each NULL-terminated</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@ -4374,12 +4376,12 @@
|
|||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><link linkend="view-pg-prepared-statements"><structname>pg_prepared_statements</structname></link></entry>
|
<entry><link linkend="view-pg-prepared-statements"><structname>pg_prepared_statements</structname></link></entry>
|
||||||
<entry>current prepared statements</entry>
|
<entry>prepared statements</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry><link linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link></entry>
|
<entry><link linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link></entry>
|
||||||
<entry>currently prepared transactions</entry>
|
<entry>prepared transactions</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -4684,7 +4686,7 @@
|
|||||||
<entry><type>xid</type></entry>
|
<entry><type>xid</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
ID of the transaction that is holding or awaiting this lock.
|
ID of the transaction that is holding or awaiting this lock
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -4693,7 +4695,7 @@
|
|||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
Process ID of the server process holding or awaiting this
|
Process ID of the server process holding or awaiting this
|
||||||
lock. Null if the lock is held by a prepared transaction.
|
lock. NULL if the lock is held by a prepared transaction.
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -4801,10 +4803,9 @@
|
|||||||
<para>
|
<para>
|
||||||
<structname>pg_prepared_statements</structname> contains one row
|
<structname>pg_prepared_statements</structname> contains one row
|
||||||
for each prepared statement. Rows are added to the view when a new
|
for each prepared statement. Rows are added to the view when a new
|
||||||
prepared statement is created, and removed when a prepared
|
prepared statement is created and removed when a prepared statement
|
||||||
statement is released (for example, via the <xref
|
is released (for example, via the <xref linkend="sql-deallocate"
|
||||||
linkend="sql-deallocate" endterm="sql-deallocate-title">
|
endterm="sql-deallocate-title"> command).
|
||||||
command).
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
@ -4825,7 +4826,7 @@
|
|||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
The identifier of the prepared statement.
|
The identifier of the prepared statement
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -4846,16 +4847,18 @@
|
|||||||
<entry><type>timestamptz</type></entry>
|
<entry><type>timestamptz</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
The time at which the prepared statement was created.
|
The time at which the prepared statement was created
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><structfield>parameter_types</structfield></entry>
|
<entry><structfield>parameter_types</structfield></entry>
|
||||||
<entry><type>oid[]</type></entry>
|
<entry><type>regtype[]</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>
|
<entry>
|
||||||
The expected parameter types for the prepared statement in the form of
|
The expected parameter types for the prepared statement in the
|
||||||
an array of type OIDs.
|
form of an array of <type>regtype</type>. The OID corresponding
|
||||||
|
to an element of this array can be obtained by casting the
|
||||||
|
<type>regtype</type> value to <type>oid</type>.
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
@ -4866,7 +4869,7 @@
|
|||||||
<literal>true</literal> if the prepared statement was created
|
<literal>true</literal> if the prepared statement was created
|
||||||
via the <command>PREPARE</command> SQL statement;
|
via the <command>PREPARE</command> SQL statement;
|
||||||
<literal>false</literal> if the statement was prepared via the
|
<literal>false</literal> if the statement was prepared via the
|
||||||
frontend/backend protocol.
|
frontend/backend protocol
|
||||||
</entry>
|
</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -5733,7 +5736,7 @@
|
|||||||
<entry><structfield>definition</structfield></entry>
|
<entry><structfield>definition</structfield></entry>
|
||||||
<entry><type>text</type></entry>
|
<entry><type>text</type></entry>
|
||||||
<entry></entry>
|
<entry></entry>
|
||||||
<entry>view definition (a reconstructed SELECT query)</entry>
|
<entry>view definition (a reconstructed <command>SELECT</command> query)</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.23 2006/01/08 07:00:25 neilc Exp $
|
* $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.24 2006/01/16 18:15:30 neilc Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CREATE VIEW pg_roles AS
|
CREATE VIEW pg_roles AS
|
||||||
@ -160,7 +160,7 @@ CREATE VIEW pg_prepared_statements AS
|
|||||||
SELECT P.name, P.statement, P.prepare_time, P.parameter_types, P.from_sql
|
SELECT P.name, P.statement, P.prepare_time, P.parameter_types, P.from_sql
|
||||||
FROM pg_prepared_statement() AS P
|
FROM pg_prepared_statement() AS P
|
||||||
(name text, statement text, prepare_time timestamptz,
|
(name text, statement text, prepare_time timestamptz,
|
||||||
parameter_types oid[], from_sql boolean);
|
parameter_types regtype[], from_sql boolean);
|
||||||
|
|
||||||
CREATE VIEW pg_settings AS
|
CREATE VIEW pg_settings AS
|
||||||
SELECT *
|
SELECT *
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Copyright (c) 2002-2005, PostgreSQL Global Development Group
|
* Copyright (c) 2002-2005, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.45 2006/01/08 07:00:25 neilc Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.46 2006/01/16 18:15:30 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -45,7 +45,7 @@ static HTAB *prepared_queries = NULL;
|
|||||||
static void InitQueryHashTable(void);
|
static void InitQueryHashTable(void);
|
||||||
static ParamListInfo EvaluateParams(EState *estate,
|
static ParamListInfo EvaluateParams(EState *estate,
|
||||||
List *params, List *argtypes);
|
List *params, List *argtypes);
|
||||||
static Datum build_oid_array(List *oid_list);
|
static Datum build_regtype_array(List *oid_list);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implements the 'PREPARE' utility statement.
|
* Implements the 'PREPARE' utility statement.
|
||||||
@ -674,7 +674,7 @@ ExplainExecuteQuery(ExplainStmt *stmt, ParamListInfo params,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This set returning function reads all the prepared statements and
|
* This set returning function reads all the prepared statements and
|
||||||
* returns a set of (name, statement, prepare_time, param_types).
|
* returns a set of (name, statement, prepare_time, param_types, from_sql).
|
||||||
*/
|
*/
|
||||||
Datum
|
Datum
|
||||||
pg_prepared_statement(PG_FUNCTION_ARGS)
|
pg_prepared_statement(PG_FUNCTION_ARGS)
|
||||||
@ -721,7 +721,7 @@ pg_prepared_statement(PG_FUNCTION_ARGS)
|
|||||||
TupleDescInitEntry(tupdesc, (AttrNumber) 3, "prepare_time",
|
TupleDescInitEntry(tupdesc, (AttrNumber) 3, "prepare_time",
|
||||||
TIMESTAMPTZOID, -1, 0);
|
TIMESTAMPTZOID, -1, 0);
|
||||||
TupleDescInitEntry(tupdesc, (AttrNumber) 4, "parameter_types",
|
TupleDescInitEntry(tupdesc, (AttrNumber) 4, "parameter_types",
|
||||||
OIDARRAYOID, -1, 0);
|
REGTYPEARRAYOID, -1, 0);
|
||||||
TupleDescInitEntry(tupdesc, (AttrNumber) 5, "from_sql",
|
TupleDescInitEntry(tupdesc, (AttrNumber) 5, "from_sql",
|
||||||
BOOLOID, -1, 0);
|
BOOLOID, -1, 0);
|
||||||
|
|
||||||
@ -757,7 +757,7 @@ pg_prepared_statement(PG_FUNCTION_ARGS)
|
|||||||
CStringGetDatum(prep_stmt->query_string));
|
CStringGetDatum(prep_stmt->query_string));
|
||||||
|
|
||||||
values[2] = TimestampTzGetDatum(prep_stmt->prepare_time);
|
values[2] = TimestampTzGetDatum(prep_stmt->prepare_time);
|
||||||
values[3] = build_oid_array(prep_stmt->argtype_list);
|
values[3] = build_regtype_array(prep_stmt->argtype_list);
|
||||||
values[4] = BoolGetDatum(prep_stmt->from_sql);
|
values[4] = BoolGetDatum(prep_stmt->from_sql);
|
||||||
|
|
||||||
tuple = heap_form_tuple(funcctx->tuple_desc, values, nulls);
|
tuple = heap_form_tuple(funcctx->tuple_desc, values, nulls);
|
||||||
@ -770,26 +770,33 @@ pg_prepared_statement(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This utility function takes a List of Oids, and returns a Datum
|
* This utility function takes a List of Oids, and returns a Datum
|
||||||
* pointing to a Postgres array containing those OIDs. The empty list
|
* pointing to a one-dimensional Postgres array of regtypes. The empty
|
||||||
* is returned as a zero-element array, not NULL.
|
* list is returned as a zero-element array, not NULL.
|
||||||
*/
|
*/
|
||||||
static Datum
|
static Datum
|
||||||
build_oid_array(List *oid_list)
|
build_regtype_array(List *oid_list)
|
||||||
{
|
{
|
||||||
ListCell *lc;
|
ListCell *lc;
|
||||||
int len;
|
int len;
|
||||||
int i;
|
int i;
|
||||||
Datum *tmp_ary;
|
Datum *tmp_ary;
|
||||||
ArrayType *ary;
|
ArrayType *result;
|
||||||
|
|
||||||
len = list_length(oid_list);
|
len = list_length(oid_list);
|
||||||
tmp_ary = (Datum *) palloc(len * sizeof(Datum));
|
tmp_ary = (Datum *) palloc(len * sizeof(Datum));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
foreach(lc, oid_list)
|
foreach(lc, oid_list)
|
||||||
tmp_ary[i++] = ObjectIdGetDatum(lfirst_oid(lc));
|
{
|
||||||
|
Oid oid;
|
||||||
|
Datum oid_str;
|
||||||
|
|
||||||
/* XXX: this hardcodes assumptions about the OID type... */
|
oid = lfirst_oid(lc);
|
||||||
ary = construct_array(tmp_ary, len, OIDOID, sizeof(Oid), true, 'i');
|
oid_str = DirectFunctionCall1(oidout, ObjectIdGetDatum(oid));
|
||||||
return PointerGetDatum(ary);
|
tmp_ary[i++] = DirectFunctionCall1(regtypein, oid_str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* XXX: this hardcodes assumptions about the regtype type */
|
||||||
|
result = construct_array(tmp_ary, len, REGTYPEOID, 4, true, 'i');
|
||||||
|
return PointerGetDatum(result);
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.310 2006/01/11 20:12:39 tgl Exp $
|
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.311 2006/01/16 18:15:30 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -53,6 +53,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 200601111
|
#define CATALOG_VERSION_NO 200601161
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.168 2006/01/08 07:00:26 neilc Exp $
|
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.169 2006/01/16 18:15:30 neilc Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* the genbki.sh script reads this file and generates .bki
|
* the genbki.sh script reads this file and generates .bki
|
||||||
@ -406,7 +406,6 @@ DATA(insert OID = 1007 ( _int4 PGNSP PGUID -1 f b t \054 0 23 array_in array_
|
|||||||
DATA(insert OID = 1008 ( _regproc PGNSP PGUID -1 f b t \054 0 24 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
DATA(insert OID = 1008 ( _regproc PGNSP PGUID -1 f b t \054 0 24 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
||||||
DATA(insert OID = 1009 ( _text PGNSP PGUID -1 f b t \054 0 25 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
DATA(insert OID = 1009 ( _text PGNSP PGUID -1 f b t \054 0 25 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
||||||
DATA(insert OID = 1028 ( _oid PGNSP PGUID -1 f b t \054 0 26 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
DATA(insert OID = 1028 ( _oid PGNSP PGUID -1 f b t \054 0 26 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
||||||
#define OIDARRAYOID 1028
|
|
||||||
DATA(insert OID = 1010 ( _tid PGNSP PGUID -1 f b t \054 0 27 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
DATA(insert OID = 1010 ( _tid PGNSP PGUID -1 f b t \054 0 27 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
||||||
DATA(insert OID = 1011 ( _xid PGNSP PGUID -1 f b t \054 0 28 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
DATA(insert OID = 1011 ( _xid PGNSP PGUID -1 f b t \054 0 28 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
||||||
DATA(insert OID = 1012 ( _cid PGNSP PGUID -1 f b t \054 0 29 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
DATA(insert OID = 1012 ( _cid PGNSP PGUID -1 f b t \054 0 29 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
||||||
@ -517,6 +516,7 @@ DATA(insert OID = 2208 ( _regoper PGNSP PGUID -1 f b t \054 0 2203 array_in a
|
|||||||
DATA(insert OID = 2209 ( _regoperator PGNSP PGUID -1 f b t \054 0 2204 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
DATA(insert OID = 2209 ( _regoperator PGNSP PGUID -1 f b t \054 0 2204 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
||||||
DATA(insert OID = 2210 ( _regclass PGNSP PGUID -1 f b t \054 0 2205 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
DATA(insert OID = 2210 ( _regclass PGNSP PGUID -1 f b t \054 0 2205 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
||||||
DATA(insert OID = 2211 ( _regtype PGNSP PGUID -1 f b t \054 0 2206 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
DATA(insert OID = 2211 ( _regtype PGNSP PGUID -1 f b t \054 0 2206 array_in array_out array_recv array_send - i x f 0 -1 0 _null_ _null_ ));
|
||||||
|
#define REGTYPEARRAYOID 2211
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pseudo-types
|
* pseudo-types
|
||||||
|
@ -148,19 +148,19 @@ PREPARE q7(unknown) AS
|
|||||||
SELECT * FROM road WHERE thepath = $1;
|
SELECT * FROM road WHERE thepath = $1;
|
||||||
SELECT name, statement, parameter_types FROM pg_prepared_statements
|
SELECT name, statement, parameter_types FROM pg_prepared_statements
|
||||||
ORDER BY name;
|
ORDER BY name;
|
||||||
name | statement | parameter_types
|
name | statement | parameter_types
|
||||||
------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------
|
------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------
|
||||||
q2 | PREPARE q2(text) AS
|
q2 | PREPARE q2(text) AS
|
||||||
SELECT datname, datistemplate, datallowconn
|
SELECT datname, datistemplate, datallowconn
|
||||||
FROM pg_database WHERE datname = $1; | {25}
|
FROM pg_database WHERE datname = $1; | {text}
|
||||||
q3 | PREPARE q3(text, int, float, boolean, oid, smallint) AS
|
q3 | PREPARE q3(text, int, float, boolean, oid, smallint) AS
|
||||||
SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR
|
SELECT * FROM tenk1 WHERE string4 = $1 AND (four = $2 OR
|
||||||
ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int); | {25,23,701,16,26,21}
|
ten = $3::bigint OR true = $4 OR oid = $5 OR odd = $6::int); | {text,integer,"double precision",boolean,oid,smallint}
|
||||||
q5 | PREPARE q5(int, text) AS
|
q5 | PREPARE q5(int, text) AS
|
||||||
SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2; | {23,25}
|
SELECT * FROM tenk1 WHERE unique1 = $1 OR stringu1 = $2; | {integer,text}
|
||||||
q6 | PREPARE q6 AS
|
q6 | PREPARE q6 AS
|
||||||
SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2; | {23,19}
|
SELECT * FROM tenk1 WHERE unique1 = $1 AND stringu1 = $2; | {integer,name}
|
||||||
q7 | PREPARE q7(unknown) AS
|
q7 | PREPARE q7(unknown) AS
|
||||||
SELECT * FROM road WHERE thepath = $1; | {602}
|
SELECT * FROM road WHERE thepath = $1; | {path}
|
||||||
(5 rows)
|
(5 rows)
|
||||||
|
|
||||||
|
@ -1280,7 +1280,7 @@ SELECT viewname, definition FROM pg_views WHERE schemaname <> 'information_schem
|
|||||||
pg_group | SELECT pg_authid.rolname AS groname, pg_authid.oid AS grosysid, ARRAY(SELECT pg_auth_members.member FROM pg_auth_members WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin);
|
pg_group | SELECT pg_authid.rolname AS groname, pg_authid.oid AS grosysid, ARRAY(SELECT pg_auth_members.member FROM pg_auth_members WHERE (pg_auth_members.roleid = pg_authid.oid)) AS grolist FROM pg_authid WHERE (NOT pg_authid.rolcanlogin);
|
||||||
pg_indexes | SELECT n.nspname AS schemaname, c.relname AS tablename, i.relname AS indexname, t.spcname AS "tablespace", pg_get_indexdef(i.oid) AS indexdef FROM ((((pg_index x JOIN pg_class c ON ((c.oid = x.indrelid))) JOIN pg_class i ON ((i.oid = x.indexrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) LEFT JOIN pg_tablespace t ON ((t.oid = i.reltablespace))) WHERE ((c.relkind = 'r'::"char") AND (i.relkind = 'i'::"char"));
|
pg_indexes | SELECT n.nspname AS schemaname, c.relname AS tablename, i.relname AS indexname, t.spcname AS "tablespace", pg_get_indexdef(i.oid) AS indexdef FROM ((((pg_index x JOIN pg_class c ON ((c.oid = x.indrelid))) JOIN pg_class i ON ((i.oid = x.indexrelid))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) LEFT JOIN pg_tablespace t ON ((t.oid = i.reltablespace))) WHERE ((c.relkind = 'r'::"char") AND (i.relkind = 'i'::"char"));
|
||||||
pg_locks | SELECT l.locktype, l."database", l.relation, l.page, l.tuple, l.transactionid, l.classid, l.objid, l.objsubid, l."transaction", l.pid, l."mode", l."granted" FROM pg_lock_status() l(locktype text, "database" oid, relation oid, page integer, tuple smallint, transactionid xid, classid oid, objid oid, objsubid smallint, "transaction" xid, pid integer, "mode" text, "granted" boolean);
|
pg_locks | SELECT l.locktype, l."database", l.relation, l.page, l.tuple, l.transactionid, l.classid, l.objid, l.objsubid, l."transaction", l.pid, l."mode", l."granted" FROM pg_lock_status() l(locktype text, "database" oid, relation oid, page integer, tuple smallint, transactionid xid, classid oid, objid oid, objsubid smallint, "transaction" xid, pid integer, "mode" text, "granted" boolean);
|
||||||
pg_prepared_statements | SELECT p.name, p."statement", p.prepare_time, p.parameter_types, p.from_sql FROM pg_prepared_statement() p(name text, "statement" text, prepare_time timestamp with time zone, parameter_types oid[], from_sql boolean);
|
pg_prepared_statements | SELECT p.name, p."statement", p.prepare_time, p.parameter_types, p.from_sql FROM pg_prepared_statement() p(name text, "statement" text, prepare_time timestamp with time zone, parameter_types regtype[], from_sql boolean);
|
||||||
pg_prepared_xacts | SELECT p."transaction", p.gid, p."prepared", u.rolname AS "owner", d.datname AS "database" FROM ((pg_prepared_xact() p("transaction" xid, gid text, "prepared" timestamp with time zone, ownerid oid, dbid oid) LEFT JOIN pg_authid u ON ((p.ownerid = u.oid))) LEFT JOIN pg_database d ON ((p.dbid = d.oid)));
|
pg_prepared_xacts | SELECT p."transaction", p.gid, p."prepared", u.rolname AS "owner", d.datname AS "database" FROM ((pg_prepared_xact() p("transaction" xid, gid text, "prepared" timestamp with time zone, ownerid oid, dbid oid) LEFT JOIN pg_authid u ON ((p.ownerid = u.oid))) LEFT JOIN pg_database d ON ((p.dbid = d.oid)));
|
||||||
pg_roles | SELECT pg_authid.rolname, pg_authid.rolsuper, pg_authid.rolinherit, pg_authid.rolcreaterole, pg_authid.rolcreatedb, pg_authid.rolcatupdate, pg_authid.rolcanlogin, pg_authid.rolconnlimit, '********'::text AS rolpassword, pg_authid.rolvaliduntil, pg_authid.rolconfig, pg_authid.oid FROM pg_authid;
|
pg_roles | SELECT pg_authid.rolname, pg_authid.rolsuper, pg_authid.rolinherit, pg_authid.rolcreaterole, pg_authid.rolcreatedb, pg_authid.rolcatupdate, pg_authid.rolcanlogin, pg_authid.rolconnlimit, '********'::text AS rolpassword, pg_authid.rolvaliduntil, pg_authid.rolconfig, pg_authid.oid FROM pg_authid;
|
||||||
pg_rules | SELECT n.nspname AS schemaname, c.relname AS tablename, r.rulename, pg_get_ruledef(r.oid) AS definition FROM ((pg_rewrite r JOIN pg_class c ON ((c.oid = r.ev_class))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (r.rulename <> '_RETURN'::name);
|
pg_rules | SELECT n.nspname AS schemaname, c.relname AS tablename, r.rulename, pg_get_ruledef(r.oid) AS definition FROM ((pg_rewrite r JOIN pg_class c ON ((c.oid = r.ev_class))) LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (r.rulename <> '_RETURN'::name);
|
||||||
|
Reference in New Issue
Block a user