Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5b114b0

Browse files
committed
Make argument names of pg_get_object_address consistent, and fix docs.
pg_get_object_address and pg_identify_object_as_address are supposed to be inverses, but they disagreed as to the names of the arguments representing the textual form of an object address. Moreover, the documented argument names didn't agree with reality at all, either for these functions or pg_identify_object. In HEAD and v11, I think we can get away with renaming the input arguments of pg_get_object_address to match the outputs of pg_identify_object_as_address. In theory that might break queries using named-argument notation to call pg_get_object_address, but it seems really unlikely that anybody is doing that, or that they'd have much trouble adjusting if they were. In older branches, we'll just live with the lack of consistency. Aside from fixing the documentation of these functions to match reality, I couldn't resist the temptation to do some copy-editing. Per complaint from Jean-Pierre Pelletier. Back-patch to 9.5 where these functions were introduced. (Before v11, this is a documentation change only.) Discussion: https://postgr.es/m/CANGqjDnWH8wsTY_GzDUxbt4i=y-85SJreZin4Hm8uOqv1vzRQA@mail.gmail.com
1 parent a704f83 commit 5b114b0

File tree

1 file changed

+55
-52
lines changed

1 file changed

+55
-52
lines changed

doc/src/sgml/func.sgml

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17015,32 +17015,34 @@ SELECT collation for ('foo' COLLATE "de_DE");
1701517015

1701617016
<tbody>
1701717017
<row>
17018-
<entry><literal><function>pg_describe_object(<parameter>catalog_id</parameter>, <parameter>object_id</parameter>, <parameter>object_sub_id</parameter>)</function></literal></entry>
17018+
<entry><literal><function>pg_describe_object(<parameter>classid</parameter> <type>oid</type>, <parameter>objid</parameter> <type>oid</type>, <parameter>objsubid</parameter> <type>integer</type>)</function></literal></entry>
1701917019
<entry><type>text</type></entry>
1702017020
<entry>get description of a database object</entry>
1702117021
</row>
1702217022
<row>
17023-
<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>
17024-
<entry><parameter>type</> <type>text</>, <parameter>schema</> <type>text</>, <parameter>name</> <type>text</>, <parameter>identity</> <type>text</></entry>
17023+
<entry><literal><function>pg_identify_object(<parameter>classid</parameter> <type>oid</type>, <parameter>objid</parameter> <type>oid</type>, <parameter>objsubid</parameter> <type>integer</type>)</function></literal></entry>
17024+
<entry><parameter>type</parameter> <type>text</type>, <parameter>schema</parameter> <type>text</type>, <parameter>name</parameter> <type>text</type>, <parameter>identity</parameter> <type>text</type></entry>
1702517025
<entry>get identity of a database object</entry>
1702617026
</row>
1702717027
<row>
17028-
<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>
17029-
<entry><parameter>type</> <type>text</>, <parameter>name</> <type>text[]</>, <parameter>args</> <type>text[]</></entry>
17028+
<entry><literal><function>pg_identify_object_as_address(<parameter>classid</parameter> <type>oid</type>, <parameter>objid</parameter> <type>oid</type>, <parameter>objsubid</parameter> <type>integer</type>)</function></literal></entry>
17029+
<entry><parameter>type</parameter> <type>text</type>, <parameter>object_names</parameter> <type>text[]</type>, <parameter>object_args</parameter> <type>text[]</type></entry>
1703017030
<entry>get external representation of a database object's address</entry>
1703117031
</row>
1703217032
<row>
17033-
<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>
17034-
<entry><parameter>catalog_id</> <type>oid</>, <parameter>object_id</> <type>oid</>, <parameter>object_sub_id</> <type>int32</></entry>
17035-
<entry>get address of a database object, from its external representation</entry>
17033+
<entry><literal><function>pg_get_object_address(<parameter>type</parameter> <type>text</type>, <parameter>name</parameter> <type>text[]</type>, <parameter>args</parameter> <type>text[]</type>)</function></literal></entry>
17034+
<entry><parameter>classid</parameter> <type>oid</type>, <parameter>objid</parameter> <type>oid</type>, <parameter>objsubid</parameter> <type>integer</type></entry>
17035+
<entry>get address of a database object from its external representation</entry>
1703617036
</row>
1703717037
</tbody>
1703817038
</tgroup>
1703917039
</table>
1704017040

1704117041
<para>
1704217042
<function>pg_describe_object</function> returns a textual description of a database
17043-
object specified by catalog OID, object OID and a (possibly zero) sub-object ID.
17043+
object specified by catalog OID, object OID, and sub-object ID (such as
17044+
a column number within a table; the sub-object ID is zero when referring
17045+
to a whole object).
1704417046
This description is intended to be human-readable, and might be translated,
1704517047
depending on server configuration.
1704617048
This is useful to determine the identity of an object as stored in the
@@ -17049,30 +17051,31 @@ SELECT collation for ('foo' COLLATE "de_DE");
1704917051

1705017052
<para>
1705117053
<function>pg_identify_object</function> returns a row containing enough information
17052-
to uniquely identify the database object specified by catalog OID, object OID and a
17053-
(possibly zero) sub-object ID. This information is intended to be machine-readable,
17054+
to uniquely identify the database object specified by catalog OID, object OID and
17055+
sub-object ID. This information is intended to be machine-readable,
1705417056
and is never translated.
17055-
<parameter>type</> identifies the type of database object;
17056-
<parameter>schema</> is the schema name that the object belongs in, or
17057-
<literal>NULL</> for object types that do not belong to schemas;
17058-
<parameter>name</> is the name of the object, quoted if necessary, only
17059-
present if it can be used (alongside schema name, if pertinent) as a unique
17060-
identifier of the object, otherwise <literal>NULL</>;
17061-
<parameter>identity</> is the complete object identity, with the precise format
17062-
depending on object type, and each part within the format being
17063-
schema-qualified and quoted as necessary.
17057+
<parameter>type</parameter> identifies the type of database object;
17058+
<parameter>schema</parameter> is the schema name that the object belongs in, or
17059+
<literal>NULL</literal> for object types that do not belong to schemas;
17060+
<parameter>name</parameter> is the name of the object, quoted if necessary,
17061+
if the name (along with schema name, if pertinent) is sufficient to
17062+
uniquely identify the object, otherwise <literal>NULL</literal>;
17063+
<parameter>identity</parameter> is the complete object identity, with the
17064+
precise format depending on object type, and each name within the format
17065+
being schema-qualified and quoted as necessary.
1706417066
</para>
1706517067

1706617068
<para>
1706717069
<function>pg_identify_object_as_address</function> returns a row containing
1706817070
enough information to uniquely identify the database object specified by
17069-
catalog OID, object OID and a (possibly zero) sub-object ID. The returned
17071+
catalog OID, object OID and sub-object ID. The returned
1707017072
information is independent of the current server, that is, it could be used
1707117073
to identify an identically named object in another server.
17072-
<parameter>type</> identifies the type of database object;
17073-
<parameter>name</> and <parameter>args</> are text arrays that together
17074-
form a reference to the object. These three columns can be passed to
17075-
<function>pg_get_object_address</> to obtain the internal address
17074+
<parameter>type</parameter> identifies the type of database object;
17075+
<parameter>object_names</parameter> and <parameter>object_args</parameter>
17076+
are text arrays that together form a reference to the object.
17077+
These three values can be passed to
17078+
<function>pg_get_object_address</function> to obtain the internal address
1707617079
of the object.
1707717080
This function is the inverse of <function>pg_get_object_address</function>.
1707817081
</para>
@@ -17081,13 +17084,13 @@ SELECT collation for ('foo' COLLATE "de_DE");
1708117084
<function>pg_get_object_address</function> returns a row containing enough
1708217085
information to uniquely identify the database object specified by its
1708317086
type and object name and argument arrays. The returned values are the
17084-
ones that would be used in system catalogs such as <structname>pg_depend</>
17087+
ones that would be used in system catalogs such as <structname>pg_depend</structname>
1708517088
and can be passed to other system functions such as
17086-
<function>pg_identify_object</> or <function>pg_describe_object</>.
17087-
<parameter>catalog_id</> is the OID of the system catalog containing the
17089+
<function>pg_identify_object</function> or <function>pg_describe_object</function>.
17090+
<parameter>classid</parameter> is the OID of the system catalog containing the
1708817091
object;
17089-
<parameter>object_id</> is the OID of the object itself, and
17090-
<parameter>object_sub_id</> is the object sub-ID, or zero if none.
17092+
<parameter>objid</parameter> is the OID of the object itself, and
17093+
<parameter>objsubid</parameter> is the sub-object ID, or zero if none.
1709117094
This function is the inverse of <function>pg_identify_object_as_address</function>.
1709217095
</para>
1709317096

@@ -19782,23 +19785,23 @@ FOR EACH ROW EXECUTE PROCEDURE suppress_redundant_updates_trigger();
1978219785
<tbody>
1978319786
<row>
1978419787
<entry><literal>classid</literal></entry>
19785-
<entry><type>Oid</type></entry>
19788+
<entry><type>oid</type></entry>
1978619789
<entry>OID of catalog the object belongs in</entry>
1978719790
</row>
1978819791
<row>
1978919792
<entry><literal>objid</literal></entry>
19790-
<entry><type>Oid</type></entry>
19791-
<entry>OID of the object in the catalog</entry>
19793+
<entry><type>oid</type></entry>
19794+
<entry>OID of the object itself</entry>
1979219795
</row>
1979319796
<row>
1979419797
<entry><literal>objsubid</literal></entry>
1979519798
<entry><type>integer</type></entry>
19796-
<entry>Object sub-id (e.g. attribute number for columns)</entry>
19799+
<entry>Sub-object ID (e.g. attribute number for a column)</entry>
1979719800
</row>
1979819801
<row>
1979919802
<entry><literal>command_tag</literal></entry>
1980019803
<entry><type>text</type></entry>
19801-
<entry>command tag</entry>
19804+
<entry>Command tag</entry>
1980219805
</row>
1980319806
<row>
1980419807
<entry><literal>object_type</literal></entry>
@@ -19817,14 +19820,14 @@ FOR EACH ROW EXECUTE PROCEDURE suppress_redundant_updates_trigger();
1981719820
<entry><literal>object_identity</literal></entry>
1981819821
<entry><type>text</type></entry>
1981919822
<entry>
19820-
Text rendering of the object identity, schema-qualified. Each and every
19821-
identifier present in the identity is quoted if necessary.
19823+
Text rendering of the object identity, schema-qualified. Each
19824+
identifier included in the identity is quoted if necessary.
1982219825
</entry>
1982319826
</row>
1982419827
<row>
1982519828
<entry><literal>in_extension</literal></entry>
1982619829
<entry><type>bool</type></entry>
19827-
<entry>whether the command is part of an extension script</entry>
19830+
<entry>True if the command is part of an extension script</entry>
1982819831
</row>
1982919832
<row>
1983019833
<entry><literal>command</literal></entry>
@@ -19869,37 +19872,37 @@ FOR EACH ROW EXECUTE PROCEDURE suppress_redundant_updates_trigger();
1986919872
<tbody>
1987019873
<row>
1987119874
<entry><literal>classid</literal></entry>
19872-
<entry><type>Oid</type></entry>
19875+
<entry><type>oid</type></entry>
1987319876
<entry>OID of catalog the object belonged in</entry>
1987419877
</row>
1987519878
<row>
1987619879
<entry><literal>objid</literal></entry>
19877-
<entry><type>Oid</type></entry>
19878-
<entry>OID the object had within the catalog</entry>
19880+
<entry><type>oid</type></entry>
19881+
<entry>OID of the object itself</entry>
1987919882
</row>
1988019883
<row>
1988119884
<entry><literal>objsubid</literal></entry>
19882-
<entry><type>int32</type></entry>
19883-
<entry>Object sub-id (e.g. attribute number for columns)</entry>
19885+
<entry><type>integer</type></entry>
19886+
<entry>Sub-object ID (e.g. attribute number for a column)</entry>
1988419887
</row>
1988519888
<row>
1988619889
<entry><literal>original</literal></entry>
1988719890
<entry><type>bool</type></entry>
19888-
<entry>Flag used to identify the root object(s) of the deletion</entry>
19891+
<entry>True if this was one of the root object(s) of the deletion</entry>
1988919892
</row>
1989019893
<row>
1989119894
<entry><literal>normal</literal></entry>
1989219895
<entry><type>bool</type></entry>
1989319896
<entry>
19894-
Flag indicating that there's a normal dependency relationship
19897+
True if there was a normal dependency relationship
1989519898
in the dependency graph leading to this object
1989619899
</entry>
1989719900
</row>
1989819901
<row>
1989919902
<entry><literal>is_temporary</literal></entry>
1990019903
<entry><type>bool</type></entry>
1990119904
<entry>
19902-
Flag indicating that the object was a temporary object.
19905+
True if this was a temporary object
1990319906
</entry>
1990419907
</row>
1990519908
<row>
@@ -19928,26 +19931,26 @@ FOR EACH ROW EXECUTE PROCEDURE suppress_redundant_updates_trigger();
1992819931
<entry><literal>object_identity</literal></entry>
1992919932
<entry><type>text</type></entry>
1993019933
<entry>
19931-
Text rendering of the object identity, schema-qualified. Each and every
19932-
identifier present in the identity is quoted if necessary.
19934+
Text rendering of the object identity, schema-qualified. Each
19935+
identifier included in the identity is quoted if necessary.
1993319936
</entry>
1993419937
</row>
1993519938
<row>
1993619939
<entry><literal>address_names</literal></entry>
1993719940
<entry><type>text[]</type></entry>
1993819941
<entry>
1993919942
An array that, together with <literal>object_type</literal> and
19940-
<literal>address_args</literal>,
19941-
can be used by the <function>pg_get_object_address()</function> to
19943+
<literal>address_args</literal>, can be used by
19944+
the <function>pg_get_object_address()</function> function to
1994219945
recreate the object address in a remote server containing an
19943-
identically named object of the same kind.
19946+
identically named object of the same kind
1994419947
</entry>
1994519948
</row>
1994619949
<row>
1994719950
<entry><literal>address_args</literal></entry>
1994819951
<entry><type>text[]</type></entry>
1994919952
<entry>
19950-
Complement for <literal>address_names</literal> above.
19953+
Complement for <literal>address_names</literal>
1995119954
</entry>
1995219955
</row>
1995319956
</tbody>

0 commit comments

Comments
 (0)