On 09/23/2012 10:14:33 PM, Tom Lane wrote: > "Karl O. Pinc" <k...@meme.com> writes: > > The attached patch documents the oid column of those > > system catalogs having an oid. > > I think this is fundamentally wrong, or at least misleading, because > it > documents OID as if it were an ordinary column. Somebody who did > "select * from pg_class" and didn't see any "oid" in the result would > think the docs were wrong.
Ok. When I went looking at querying the system catalogs I got confused some time ago because oids were not listed along with the other columns. (It didn't help that the catalog I was looking at had another column of type oid.) > > It's possible that it's worth expending a boilerplate paragraph in > each > of those pages to say "this catalog has OIDs" (or that it doesn't). > But this isn't the way. How about modifying the ("printed") table layout as attached? It begins each ("printed") table documenting each catalog with a "Has OID column" Yes/No. Also, I note that pg_constraint and pg_collation are not collated properly in the docs. (Constraint comes before collation in the docs, although everything else is sorted by name.) A second patch (applied on top of the first) fixes this. Karl <k...@meme.com> Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index f999190..2dfb40f 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -332,6 +332,19 @@ <table> <title><structname>pg_aggregate</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -415,6 +428,19 @@ <table> <title><structname>pg_am</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -671,6 +697,19 @@ <table> <title><structname>pg_amop</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -807,6 +846,19 @@ <table> <title><structname>pg_amproc</structname> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -890,6 +942,19 @@ <table> <title><structname>pg_attrdef</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -967,6 +1032,19 @@ <table> <title><structname>pg_attribute</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -1247,6 +1325,19 @@ <table> <title><structname>pg_authid</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="3"> <thead> <row> @@ -1377,6 +1468,19 @@ <table> <title><structname>pg_auth_members</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -1450,6 +1554,19 @@ <table> <title><structname>pg_cast</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -1565,6 +1682,19 @@ <table> <title><structname>pg_class</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -1877,6 +2007,19 @@ <table> <title><structname>pg_event_trigger</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -1972,6 +2115,19 @@ <table> <title><structname>pg_constraint</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -2238,6 +2394,19 @@ <table> <title><structname>pg_collation</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -2338,6 +2507,19 @@ <table> <title><structname>pg_conversion</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -2431,6 +2613,19 @@ <table> <title><structname>pg_database</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -2588,6 +2783,19 @@ <table> <title><structname>pg_db_role_setting</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -2640,6 +2848,19 @@ <table> <title><structname>pg_default_acl</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -2736,6 +2957,19 @@ <table> <title><structname>pg_depend</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -2926,6 +3160,19 @@ <table> <title><structname>pg_description</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -2993,6 +3240,19 @@ <table> <title><structname>pg_enum</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3066,6 +3326,19 @@ <table> <title><structname>pg_extension</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3162,6 +3435,19 @@ <table> <title><structname>pg_foreign_data_wrapper</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3254,6 +3540,19 @@ <table> <title><structname>pg_foreign_server</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3345,6 +3644,19 @@ <table> <title><structname>pg_foreign_table</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3400,6 +3712,19 @@ <table> <title><structname>pg_index</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3600,16 +3925,29 @@ <table> <title><structname>pg_inherits</> Columns</title> - <tgroup cols="4"> + <tgroup cols="1"> <thead> <row> - <entry>Name</entry> - <entry>Type</entry> - <entry>References</entry> - <entry>Description</entry> + <entry>Has OID column</entry> </row> </thead> - + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + + <tgroup cols="4"> + <thead> + <row> + <entry>Name</entry> + <entry>Type</entry> + <entry>References</entry> + <entry>Description</entry> + </row> + </thead> + <tbody> <row> <entry><structfield>inhrelid</structfield></entry> @@ -3663,6 +4001,19 @@ <table> <title><structname>pg_language</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3796,6 +4147,19 @@ <table> <title><structname>pg_largeobject</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3863,6 +4227,19 @@ <table> <title><structname>pg_largeobject_metadata</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3915,6 +4292,19 @@ <table> <title><structname>pg_namespace</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -3983,6 +4373,19 @@ <table> <title><structname>pg_opclass</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -4081,6 +4484,19 @@ <table> <title><structname>pg_operator</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -4231,6 +4647,19 @@ <table> <title><structname>pg_opfamily</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -4312,6 +4741,19 @@ <table> <title><structname>pg_pltemplate</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="3"> <thead> <row> @@ -4415,6 +4857,19 @@ <table> <title><structname>pg_proc</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -4725,6 +5180,19 @@ <table> <title><structname>pg_range</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -4807,6 +5275,19 @@ <table> <title><structname>pg_rewrite</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -4930,6 +5411,19 @@ <table> <title><structname>pg_seclabel</structname> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5016,6 +5510,19 @@ <table> <title><structname>pg_shdepend</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5168,6 +5675,19 @@ <table> <title><structname>pg_shdescription</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5234,6 +5754,20 @@ <table> <title><structname>pg_shseclabel</structname> Columns</title> + + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5338,6 +5872,19 @@ <table> <title><structname>pg_statistic</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5476,6 +6023,19 @@ <table> <title><structname>pg_tablespace</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5544,6 +6104,19 @@ <table> <title><structname>pg_trigger</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5729,6 +6302,19 @@ <table> <title><structname>pg_ts_config</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5797,6 +6383,19 @@ <table> <title><structname>pg_ts_config_map</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5868,6 +6467,19 @@ <table> <title><structname>pg_ts_dict</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -5944,6 +6556,19 @@ <table> <title><structname>pg_ts_parser</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -6034,6 +6659,19 @@ <table> <title><structname>pg_ts_template</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -6101,6 +6739,19 @@ <table> <title><structname>pg_type</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row> @@ -6512,6 +7163,19 @@ <table id="catalog-typcategory-table"> <title><structfield>typcategory</> Codes</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>No</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="2"> <thead> <row> @@ -6606,6 +7270,19 @@ <table> <title><structname>pg_user_mapping</> Columns</title> + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + <tgroup cols="4"> <thead> <row>
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 2dfb40f..2b85ba4 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -2087,6 +2087,120 @@ </table> </sect1> + <sect1 id="catalog-pg-collation"> + <title><structname>pg_collation</structname></title> + + <indexterm zone="catalog-pg-collation"> + <primary>pg_collation</primary> + </indexterm> + + <para> + The catalog <structname>pg_collation</structname> describes the + available collations, which are essentially mappings from an SQL + name to operating system locale categories. + See <xref linkend="collation"> for more information. + </para> + + <table> + <title><structname>pg_collation</> Columns</title> + + <tgroup cols="1"> + <thead> + <row> + <entry>Has OID column</entry> + </row> + </thead> + <tbody> + <row> + <entry>Yes</entry> + </row> + </tbody> + </tgroup> + + <tgroup cols="4"> + <thead> + <row> + <entry>Name</entry> + <entry>Type</entry> + <entry>References</entry> + <entry>Description</entry> + </row> + </thead> + + <tbody> + <row> + <entry><structfield>collname</structfield></entry> + <entry><type>name</type></entry> + <entry></entry> + <entry>Collation name (unique per namespace and encoding)</entry> + </row> + + <row> + <entry><structfield>collnamespace</structfield></entry> + <entry><type>oid</type></entry> + <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry> + <entry> + The OID of the namespace that contains this collation + </entry> + </row> + + <row> + <entry><structfield>collowner</structfield></entry> + <entry><type>oid</type></entry> + <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry> + <entry>Owner of the collation</entry> + </row> + + <row> + <entry><structfield>collencoding</structfield></entry> + <entry><type>int4</type></entry> + <entry></entry> + <entry>Encoding in which the collation is applicable, or -1 if it + works for any encoding</entry> + </row> + + <row> + <entry><structfield>collcollate</structfield></entry> + <entry><type>name</type></entry> + <entry></entry> + <entry><symbol>LC_COLLATE</> for this collation object</entry> + </row> + + <row> + <entry><structfield>collctype</structfield></entry> + <entry><type>name</type></entry> + <entry></entry> + <entry><symbol>LC_CTYPE</> for this collation object</entry> + </row> + </tbody> + </tgroup> + </table> + + <para> + Note that the unique key on this catalog is (<structfield>collname</>, + <structfield>collencoding</>, <structfield>collnamespace</>) not just + (<structfield>collname</>, <structfield>collnamespace</>). + <productname>PostgreSQL</productname> generally ignores all + collations that do not have <structfield>collencoding</> equal to + either the current database's encoding or -1, and creation of new entries + with the same name as an entry with <structfield>collencoding</> = -1 + is forbidden. Therefore it is sufficient to use a qualified SQL name + (<replaceable>schema</>.<replaceable>name</>) to identify a collation, + even though this is not unique according to the catalog definition. + The reason for defining the catalog this way is that + <application>initdb</> fills it in at cluster initialization time with + entries for all locales available on the system, so it must be able to + hold entries for all encodings that might ever be used in the cluster. + </para> + + <para> + In the <literal>template0</> database, it could be useful to create + collations whose encoding does not match the database encoding, + since they could match the encodings of databases later cloned from + <literal>template0</>. This would currently have to be done manually. + </para> + </sect1> + <sect1 id="catalog-pg-constraint"> <title><structname>pg_constraint</structname></title> @@ -2377,120 +2491,6 @@ </sect1> - <sect1 id="catalog-pg-collation"> - <title><structname>pg_collation</structname></title> - - <indexterm zone="catalog-pg-collation"> - <primary>pg_collation</primary> - </indexterm> - - <para> - The catalog <structname>pg_collation</structname> describes the - available collations, which are essentially mappings from an SQL - name to operating system locale categories. - See <xref linkend="collation"> for more information. - </para> - - <table> - <title><structname>pg_collation</> Columns</title> - - <tgroup cols="1"> - <thead> - <row> - <entry>Has OID column</entry> - </row> - </thead> - <tbody> - <row> - <entry>Yes</entry> - </row> - </tbody> - </tgroup> - - <tgroup cols="4"> - <thead> - <row> - <entry>Name</entry> - <entry>Type</entry> - <entry>References</entry> - <entry>Description</entry> - </row> - </thead> - - <tbody> - <row> - <entry><structfield>collname</structfield></entry> - <entry><type>name</type></entry> - <entry></entry> - <entry>Collation name (unique per namespace and encoding)</entry> - </row> - - <row> - <entry><structfield>collnamespace</structfield></entry> - <entry><type>oid</type></entry> - <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry> - <entry> - The OID of the namespace that contains this collation - </entry> - </row> - - <row> - <entry><structfield>collowner</structfield></entry> - <entry><type>oid</type></entry> - <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry> - <entry>Owner of the collation</entry> - </row> - - <row> - <entry><structfield>collencoding</structfield></entry> - <entry><type>int4</type></entry> - <entry></entry> - <entry>Encoding in which the collation is applicable, or -1 if it - works for any encoding</entry> - </row> - - <row> - <entry><structfield>collcollate</structfield></entry> - <entry><type>name</type></entry> - <entry></entry> - <entry><symbol>LC_COLLATE</> for this collation object</entry> - </row> - - <row> - <entry><structfield>collctype</structfield></entry> - <entry><type>name</type></entry> - <entry></entry> - <entry><symbol>LC_CTYPE</> for this collation object</entry> - </row> - </tbody> - </tgroup> - </table> - - <para> - Note that the unique key on this catalog is (<structfield>collname</>, - <structfield>collencoding</>, <structfield>collnamespace</>) not just - (<structfield>collname</>, <structfield>collnamespace</>). - <productname>PostgreSQL</productname> generally ignores all - collations that do not have <structfield>collencoding</> equal to - either the current database's encoding or -1, and creation of new entries - with the same name as an entry with <structfield>collencoding</> = -1 - is forbidden. Therefore it is sufficient to use a qualified SQL name - (<replaceable>schema</>.<replaceable>name</>) to identify a collation, - even though this is not unique according to the catalog definition. - The reason for defining the catalog this way is that - <application>initdb</> fills it in at cluster initialization time with - entries for all locales available on the system, so it must be able to - hold entries for all encodings that might ever be used in the cluster. - </para> - - <para> - In the <literal>template0</> database, it could be useful to create - collations whose encoding does not match the database encoding, - since they could match the encodings of databases later cloned from - <literal>template0</>. This would currently have to be done manually. - </para> - </sect1> - <sect1 id="catalog-pg-conversion"> <title><structname>pg_conversion</structname></title>
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers