バージョンごとのドキュメント一覧

53.12. pg_collation #

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. pg_collationカタログは利用可能、SQL名とオペレーティングシステムのロケールカテゴリとの基本的な対応付けを行う照合順序を記述します。 詳細は 24.2を参照してください。

表53.12 pg_collationの列

<title><structname>pg_collation</structname> Columns</title>

Column Type 列 型

Description 説明

oid oid

Row identifier 行識別子

collname name

Collation name (unique per namespace and encoding) 照合順序の名前(名前空間およびエンコード方式で一意)

collnamespace oid (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>oid</structfield>) (参照先 pg_namespace.oid

The OID of the namespace that contains this collation この照合順序を含む名前空間のOID

collowner oid (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>) (参照先 pg_authid.oid

Owner of the collation 照合順序の所有者

collprovider char

Provider of the collation: <literal>d</literal> = database default, <literal>c</literal> = libc, <literal>i</literal> = icu 照合順序の提供者: d = データベースのデフォルト、 c = libc、 i = icu

collisdeterministic bool

Is the collation deterministic? 照合順序は決定論的か?

collencoding int4

Encoding in which the collation is applicable, or -1 if it works for any encoding この照合順序を適用できるエンコード方式。任意のエンコード方式で動作する場合は-1

collcollate text

<symbol>LC_COLLATE</symbol> for this collation object この照合順序オブジェクト用のLC_COLLATE

collctype text

<symbol>LC_CTYPE</symbol> for this collation object この照合順序オブジェクト用のLC_CTYPE

colliculocale text

ICU locale ID for this collation object この照合オブジェクトのICUロケールID

collicurules text

ICU collation rules for this collation object この照合オブジェクトのICU照合規則

collversion text

Provider-specific version of the collation. This is recorded when the collation is created and then checked when it is used, to detect changes in the collation definition that could lead to data corruption. この照合順序に対する提供者固有のバージョンです。 これは照合順序が作成された時に記録され、データの破壊につながりかねない照合順序定義の変更を検知するために使用時に検査されます。


Note that the unique key on this catalog is (<structfield>collname</structfield>, <structfield>collencoding</structfield>, <structfield>collnamespace</structfield>) not just (<structfield>collname</structfield>, <structfield>collnamespace</structfield>). <productname>PostgreSQL</productname> generally ignores all collations that do not have <structfield>collencoding</structfield> 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</structfield> = -1 is forbidden. Therefore it is sufficient to use a qualified SQL name (<replaceable>schema</replaceable>.<replaceable>name</replaceable>) 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</application> 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. このカタログの一意キーは(collname, collnamespace)だけではなく(collname,collencoding, collnamespace)です。 PostgreSQLは通常、collencodingが現在のデータベースのエンコード方式または-1と一致しない照合順序をすべて無視します。 また、collencoding = -1を持つ項目と名前が一致する新しい項目の作成は許されません。 したがって照合順序を識別するためには、カタログの定義に従った一意ではない場合であっても、限定されたSQL名称(schema.name)を使用することで十分です。 このようにカタログを定義した理由は、クラスタの初期化時にinitdb がシステムで利用可能なすべてのロケール用の項目でこのカタログにデータを投入するためです。 その為、今後そのクラスタで使用される可能性があるすべてのエンコード方式のエントリーを保持できるようにしなければなりません。

In the <literal>template0</literal> 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</literal>. This would currently have to be done manually. 後でtemplate0から複製されるデータベースのエンコード方式と一致するかもしれないので、template0データベースのデータベースのエンコード方式と一致しないものの照合順を作成することが有用になるかもしれません。 現在これは手作業で行う必要があります。