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.
This commit is contained in:
parent
6f72dbc48b
commit
8408e3a557
@ -4472,30 +4472,10 @@ INSERT INTO mytable VALUES(-1); -- fails
|
||||
<primary>oid</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regproc</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regprocedure</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regoper</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regoperator</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regclass</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regtype</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regconfig</primary>
|
||||
</indexterm>
|
||||
@ -4505,7 +4485,31 @@ INSERT INTO mytable VALUES(-1); -- fails
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>xid</primary>
|
||||
<primary>regnamespace</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regoper</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regoperator</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regproc</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<primary>regprocedure</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-oid">
|
||||
<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>regconfig</type></entry>
|
||||
<entry><structname>pg_ts_config</structname></entry>
|
||||
<entry>text search configuration</entry>
|
||||
<entry><literal>english</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>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>
|
||||
@ -18193,18 +18193,18 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
<primary>to_regoperator</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>to_regproc</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>to_regprocedure</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>to_regtype</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>to_regnamespace</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>to_regrole</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<xref linkend="functions-info-catalog-table"/> lists functions that
|
||||
extract information from the system catalogs.
|
||||
@ -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>
|
||||
@ -18409,21 +18404,26 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
<entry><type>regoperator</type></entry>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</table>
|
||||
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user