Commit 8408e3a5 authored by Peter Eisentraut's avatar Peter Eisentraut

doc: Update documentation about reg* types

Add missing index entries, add missing information on pg_upgrade man
page, order things alphabetical instead of (apparently) in the order
they were implemented, reduce repetitiveness a bit.
parent 6f72dbc4
......@@ -4473,39 +4473,43 @@ INSERT INTO mytable VALUES(-1); -- fails
</indexterm>
<indexterm zone="datatype-oid">
<primary>regproc</primary>
<primary>regclass</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>regprocedure</primary>
<primary>regconfig</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>regoper</primary>
<primary>regdictionary</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>regoperator</primary>
<primary>regnamespace</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>regclass</primary>
<primary>regoper</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>regtype</primary>
<primary>regoperator</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>regconfig</primary>
<primary>regproc</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>regdictionary</primary>
<primary>regprocedure</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>xid</primary>
<primary>regrole</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>regtype</primary>
</indexterm>
<indexterm zone="datatype-oid">
......@@ -4516,17 +4520,17 @@ INSERT INTO mytable VALUES(-1); -- fails
<primary>tid</primary>
</indexterm>
<indexterm zone="datatype-oid">
<primary>xid</primary>
</indexterm>
<para>
Object identifiers (OIDs) are used internally by
<productname>PostgreSQL</productname> as primary keys for various
system tables.
Type <type>oid</type> represents an object identifier. There are also
several alias types for <type>oid</type>: <type>regproc</type>,
<type>regprocedure</type>, <type>regoper</type>, <type>regoperator</type>,
<type>regclass</type>, <type>regtype</type>, <type>regrole</type>,
<type>regnamespace</type>, <type>regconfig</type>, and
<type>regdictionary</type>. <xref linkend="datatype-oid-table"/> shows an
several alias types for <type>oid</type> named <type>reg<replaceable>something</replaceable></type>.
<xref linkend="datatype-oid-table"/> shows an
overview.
</para>
......@@ -4592,17 +4596,32 @@ SELECT * FROM pg_attribute
</row>
<row>
<entry><type>regproc</type></entry>
<entry><structname>pg_proc</structname></entry>
<entry>function name</entry>
<entry><literal>sum</literal></entry>
<entry><type>regclass</type></entry>
<entry><structname>pg_class</structname></entry>
<entry>relation name</entry>
<entry><literal>pg_type</literal></entry>
</row>
<row>
<entry><type>regprocedure</type></entry>
<entry><structname>pg_proc</structname></entry>
<entry>function with argument types</entry>
<entry><literal>sum(int4)</literal></entry>
<entry><type>regconfig</type></entry>
<entry><structname>pg_ts_config</structname></entry>
<entry>text search configuration</entry>
<entry><literal>english</literal></entry>
</row>
<row>
<entry><type>regdictionary</type></entry>
<entry><structname>pg_ts_dict</structname></entry>
<entry>text search dictionary</entry>
<entry><literal>simple</literal></entry>
</row>
<row>
<entry><type>regnamespace</type></entry>
<entry><structname>pg_namespace</structname></entry>
<entry>namespace name</entry>
<entry><literal>pg_catalog</literal></entry>
</row>
<row>
......@@ -4620,17 +4639,17 @@ SELECT * FROM pg_attribute
</row>
<row>
<entry><type>regclass</type></entry>
<entry><structname>pg_class</structname></entry>
<entry>relation name</entry>
<entry><literal>pg_type</literal></entry>
<entry><type>regproc</type></entry>
<entry><structname>pg_proc</structname></entry>
<entry>function name</entry>
<entry><literal>sum</literal></entry>
</row>
<row>
<entry><type>regtype</type></entry>
<entry><structname>pg_type</structname></entry>
<entry>data type name</entry>
<entry><literal>integer</literal></entry>
<entry><type>regprocedure</type></entry>
<entry><structname>pg_proc</structname></entry>
<entry>function with argument types</entry>
<entry><literal>sum(int4)</literal></entry>
</row>
<row>
......@@ -4641,24 +4660,10 @@ SELECT * FROM pg_attribute
</row>
<row>
<entry><type>regnamespace</type></entry>
<entry><structname>pg_namespace</structname></entry>
<entry>namespace name</entry>
<entry><literal>pg_catalog</literal></entry>
</row>
<row>
<entry><type>regconfig</type></entry>
<entry><structname>pg_ts_config</structname></entry>
<entry>text search configuration</entry>
<entry><literal>english</literal></entry>
</row>
<row>
<entry><type>regdictionary</type></entry>
<entry><structname>pg_ts_dict</structname></entry>
<entry>text search dictionary</entry>
<entry><literal>simple</literal></entry>
<entry><type>regtype</type></entry>
<entry><structname>pg_type</structname></entry>
<entry>data type name</entry>
<entry><literal>integer</literal></entry>
</row>
</tbody>
</tgroup>
......
......@@ -18178,11 +18178,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
</indexterm>
<indexterm>
<primary>to_regproc</primary>
<primary>to_regnamespace</primary>
</indexterm>
<indexterm>
<primary>to_regprocedure</primary>
<primary>to_regrole</primary>
</indexterm>
<indexterm>
......@@ -18194,15 +18194,15 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
</indexterm>
<indexterm>
<primary>to_regtype</primary>
<primary>to_regproc</primary>
</indexterm>
<indexterm>
<primary>to_regnamespace</primary>
<primary>to_regprocedure</primary>
</indexterm>
<indexterm>
<primary>to_regrole</primary>
<primary>to_regtype</primary>
</indexterm>
<para>
......@@ -18390,14 +18390,9 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<entry>get the OID of the named relation</entry>
</row>
<row>
<entry><literal><function>to_regproc(<parameter>func_name</parameter>)</function></literal></entry>
<entry><type>regproc</type></entry>
<entry>get the OID of the named function</entry>
</row>
<row>
<entry><literal><function>to_regprocedure(<parameter>func_name</parameter>)</function></literal></entry>
<entry><type>regprocedure</type></entry>
<entry>get the OID of the named function</entry>
<entry><literal><function>to_regnamespace(<parameter>schema_name</parameter>)</function></literal></entry>
<entry><type>regnamespace</type></entry>
<entry>get the OID of the named schema</entry>
</row>
<row>
<entry><literal><function>to_regoper(<parameter>operator_name</parameter>)</function></literal></entry>
......@@ -18410,19 +18405,24 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<entry>get the OID of the named operator</entry>
</row>
<row>
<entry><literal><function>to_regtype(<parameter>type_name</parameter>)</function></literal></entry>
<entry><type>regtype</type></entry>
<entry>get the OID of the named type</entry>
<entry><literal><function>to_regrole(<parameter>role_name</parameter>)</function></literal></entry>
<entry><type>regrole</type></entry>
<entry>get the OID of the named role</entry>
</row>
<row>
<entry><literal><function>to_regnamespace(<parameter>schema_name</parameter>)</function></literal></entry>
<entry><type>regnamespace</type></entry>
<entry>get the OID of the named schema</entry>
<entry><literal><function>to_regproc(<parameter>func_name</parameter>)</function></literal></entry>
<entry><type>regproc</type></entry>
<entry>get the OID of the named function</entry>
</row>
<row>
<entry><literal><function>to_regrole(<parameter>role_name</parameter>)</function></literal></entry>
<entry><type>regrole</type></entry>
<entry>get the OID of the named role</entry>
<entry><literal><function>to_regprocedure(<parameter>func_name</parameter>)</function></literal></entry>
<entry><type>regprocedure</type></entry>
<entry>get the OID of the named function</entry>
</row>
<row>
<entry><literal><function>to_regtype(<parameter>type_name</parameter>)</function></literal></entry>
<entry><type>regtype</type></entry>
<entry>get the OID of the named type</entry>
</row>
</tbody>
</tgroup>
......@@ -18720,20 +18720,18 @@ SELECT collation for ('foo' COLLATE "de_DE");
</para>
<para>
The <function>to_regclass</function>, <function>to_regproc</function>,
<function>to_regprocedure</function>, <function>to_regoper</function>,
<function>to_regoperator</function>, <function>to_regtype</function>,
<function>to_regnamespace</function>, and <function>to_regrole</function>
functions translate relation, function, operator, type, schema, and role
names (given as <type>text</type>) to objects of
type <type>regclass</type>, <type>regproc</type>, <type>regprocedure</type>,
<type>regoper</type>, <type>regoperator</type>, <type>regtype</type>,
<type>regnamespace</type>, and <type>regrole</type>
respectively. These functions differ from a cast from
text in that they don't accept a numeric OID, and that they return null
rather than throwing an error if the name is not found (or, for
<function>to_regproc</function> and <function>to_regoper</function>, if
the given name matches multiple objects).
The functions <function>to_regclass</function>,
<function>to_regnamespace</function>, <function>to_regoper</function>,
<function>to_regoperator</function>, <function>to_regrole</function>,
<function>to_regproc</function>, <function>to_regprocedure</function>, and
<function>to_regtype</function>, functions translate relation, schema,
operator, role, function, and type names (given as <type>text</type>) to
objects of the corresponding <type>reg*</type> type (see <xref
linkend="datatype-oid"/> about the types). These functions differ from a
cast from text in that they don't accept a numeric OID, and that they
return null rather than throwing an error if the name is not found (or, for
<function>to_regproc</function> and <function>to_regoper</function>, if the
given name matches multiple objects).
</para>
<indexterm>
......
......@@ -773,9 +773,16 @@ psql --username=postgres --file=script.sql postgres
<para>
<application>pg_upgrade</application> does not support upgrading of databases
containing table columns using these <type>reg*</type> OID-referencing system data types:
<type>regproc</type>, <type>regprocedure</type>, <type>regoper</type>,
<type>regoperator</type>, <type>regconfig</type>, and
<type>regdictionary</type>. (<type>regtype</type> can be upgraded.)
<simplelist>
<member><type>regconfig</type></member>
<member><type>regdictionary</type></member>
<member><type>regnamespace</type></member>
<member><type>regoper</type></member>
<member><type>regoperator</type></member>
<member><type>regproc</type></member>
<member><type>regprocedure</type></member>
</simplelist>
(<type>regclass</type>, <type>regrole</type>, and <type>regtype</type> can be upgraded.)
</para>
<para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment