summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2014-12-30 15:41:50 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2014-12-30 15:41:50 -0300
commita676201490c8113b4692562126c77a29dfd8dac1 (patch)
tree79c188b9f7402d4b006a4a9d86b24b82f0fa3401 /doc/src
parent5b447ad3a98aa6f059ba467eb10a832eb1544985 (diff)
Add pg_identify_object_as_address
This function returns object type and objname/objargs arrays, which can be passed to pg_get_object_address. This is especially useful because the textual representation can be copied to a remote server in order to obtain the corresponding OID-based address. In essence, this function is the inverse of recently added pg_get_object_address(). Catalog version bumped due to the addition of the new function. Also add docs to pg_get_object_address.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml149
1 files changed, 106 insertions, 43 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 24c64b7187f..53aeb12f9a5 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -15308,14 +15308,6 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
</indexterm>
<indexterm>
- <primary>pg_describe_object</primary>
- </indexterm>
-
- <indexterm>
- <primary>pg_identify_object</primary>
- </indexterm>
-
- <indexterm>
<primary>pg_get_constraintdef</primary>
</indexterm>
@@ -15430,16 +15422,6 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<entry>get SQL name of a data type</entry>
</row>
<row>
- <entry><literal><function>pg_describe_object(<parameter>catalog_id</parameter>, <parameter>object_id</parameter>, <parameter>object_sub_id</parameter>)</function></literal></entry>
- <entry><type>text</type></entry>
- <entry>get description of a database object</entry>
- </row>
- <row>
- <entry><literal><function>pg_identify_object(<parameter>catalog_id</parameter> <type>oid</>, <parameter>object_id</parameter> <type>oid</>, <parameter>object_sub_id</parameter> <type>integer</>)</function></literal></entry>
- <entry><parameter>type</> <type>text</>, <parameter>schema</> <type>text</>, <parameter>name</> <type>text</>, <parameter>identity</> <type>text</></entry>
- <entry>get identity of a database object</entry>
- </row>
- <row>
<entry><literal><function>pg_get_constraintdef(<parameter>constraint_oid</parameter>)</function></literal></entry>
<entry><type>text</type></entry>
<entry>get definition of a constraint</entry>
@@ -15708,31 +15690,6 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
</para>
<para>
- <function>pg_describe_object</function> returns a textual description of a database
- object specified by catalog OID, object OID and a (possibly zero) sub-object ID.
- This description is intended to be human-readable, and might be translated,
- depending on server configuration.
- This is useful to determine the identity of an object as stored in the
- <structname>pg_depend</structname> catalog.
- </para>
-
- <para>
- <function>pg_identify_object</function> returns a row containing enough information
- to uniquely identify the database object specified by catalog OID, object OID and a
- (possibly zero) sub-object ID. This information is intended to be machine-readable,
- and is never translated.
- <parameter>type</> identifies the type of database object;
- <parameter>schema</> is the schema name that the object belongs in, or
- <literal>NULL</> for object types that do not belong to schemas;
- <parameter>name</> is the name of the object, quoted if necessary, only
- present if it can be used (alongside schema name, if pertinent) as a unique
- identifier of the object, otherwise <literal>NULL</>;
- <parameter>identity</> is the complete object identity, with the precise format
- depending on object type, and each part within the format being
- schema-qualified and quoted as necessary.
- </para>
-
- <para>
<function>pg_typeof</function> returns the OID of the data type of the
value that is passed to it. This can be helpful for troubleshooting or
dynamically constructing SQL queries. The function is declared as
@@ -15791,6 +15748,112 @@ SELECT collation for ('foo' COLLATE "de_DE");
</para>
<indexterm>
+ <primary>pg_describe_object</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>pg_identify_object</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>pg_identify_object_as_address</primary>
+ </indexterm>
+
+ <indexterm>
+ <primary>pg_get_object_address</primary>
+ </indexterm>
+
+ <para>
+ <xref linkend="functions-info-object-table"> lists functions related to
+ database object identification and addressing.
+ </para>
+
+ <table id="functions-info-object-table">
+ <title>Object Information and Addressing Functions</title>
+ <tgroup cols="3">
+ <thead>
+ <row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry></row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal><function>pg_describe_object(<parameter>catalog_id</parameter>, <parameter>object_id</parameter>, <parameter>object_sub_id</parameter>)</function></literal></entry>
+ <entry><type>text</type></entry>
+ <entry>get description of a database object</entry>
+ </row>
+ <row>
+ <entry><literal><function>pg_identify_object(<parameter>catalog_id</parameter> <type>oid</>, <parameter>object_id</parameter> <type>oid</>, <parameter>object_sub_id</parameter> <type>integer</>)</function></literal></entry>
+ <entry><parameter>type</> <type>text</>, <parameter>schema</> <type>text</>, <parameter>name</> <type>text</>, <parameter>identity</> <type>text</></entry>
+ <entry>get identity of a database object</entry>
+ </row>
+ <row>
+ <entry><literal><function>pg_identify_object_as_address(<parameter>catalog_id</parameter> <type>oid</>, <parameter>object_id</parameter> <type>oid</>, <parameter>object_sub_id</parameter> <type>integer</>)</function></literal></entry>
+ <entry><parameter>type</> <type>text</>, <parameter>name</> <type>text[]</>, <parameter>args</> <type>text[]</></entry>
+ <entry>get external representation of a database object's address</entry>
+ </row>
+ <row>
+ <entry><literal><function>pg_get_object_address(<parameter>type</parameter> <type>text</>, <parameter>name</parameter> <type>text[]</>, <parameter>args</parameter> <type>text[]</>)</function></literal></entry>
+ <entry><parameter>catalog_id</> <type>oid</>, <parameter>object_id</> <type>oid</>, <parameter>object_sub_id</> <type>int32</></entry>
+ <entry>get address of a database object, from its external representation</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>
+ <function>pg_describe_object</function> returns a textual description of a database
+ object specified by catalog OID, object OID and a (possibly zero) sub-object ID.
+ This description is intended to be human-readable, and might be translated,
+ depending on server configuration.
+ This is useful to determine the identity of an object as stored in the
+ <structname>pg_depend</structname> catalog.
+ </para>
+
+ <para>
+ <function>pg_identify_object</function> returns a row containing enough information
+ to uniquely identify the database object specified by catalog OID, object OID and a
+ (possibly zero) sub-object ID. This information is intended to be machine-readable,
+ and is never translated.
+ <parameter>type</> identifies the type of database object;
+ <parameter>schema</> is the schema name that the object belongs in, or
+ <literal>NULL</> for object types that do not belong to schemas;
+ <parameter>name</> is the name of the object, quoted if necessary, only
+ present if it can be used (alongside schema name, if pertinent) as a unique
+ identifier of the object, otherwise <literal>NULL</>;
+ <parameter>identity</> is the complete object identity, with the precise format
+ depending on object type, and each part within the format being
+ schema-qualified and quoted as necessary.
+ </para>
+
+ <para>
+ <function>pg_identify_object_as_address</function> returns a row containing
+ enough information to uniquely identify the database object specified by
+ catalog OID, object OID and a (possibly zero) sub-object ID. The returned
+ information is independent of the current server, that is, it could be used
+ to identify an identically named object in another server.
+ <parameter>type</> identifies the type of database object;
+ <parameter>name</> and <parameter>args</> are text arrays that together
+ form a reference to the object. These three columns can be passed to
+ <function>pg_get_object_address</> to obtain the internal address
+ of the object.
+ This function is the inverse of <function>pg_get_object_address</function>.
+ </para>
+
+ <para>
+ <function>pg_get_object_address</function> returns a row containing enough
+ information to uniquely identify the database object specified by its
+ type and object name and argument arrays. The returned values are the
+ ones that would be used in system catalogs such as <structname>pg_depend</>
+ and can be passed to other system functions such as
+ <function>pg_identify_object</> or <function>pg_describe_object</>.
+ <parameter>catalog_id</> is the OID of the system catalog containing the
+ object;
+ <parameter>object_id</> is the OID of the object itself, and
+ <parameter>object_sub_id</> is the object sub-ID, or zero if none.
+ This function is the inverse of <function>pg_identify_object_as_address</function>.
+ </para>
+
+ <indexterm>
<primary>col_description</primary>
</indexterm>