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

8.12. UUID#

<title><acronym>UUID</acronym> Type</title>

The data type <type>uuid</type> stores Universally Unique Identifiers (UUID) as defined by <ulink url="https://tools.ietf.org/html/rfc4122">RFC 4122</ulink>, ISO/IEC 9834-8:2005, and related standards. (Some systems refer to this data type as a globally unique identifier, or GUID,<indexterm><primary>GUID</primary></indexterm> instead.) This identifier is a 128-bit quantity that is generated by an algorithm chosen to make it very unlikely that the same identifier will be generated by anyone else in the known universe using the same algorithm. Therefore, for distributed systems, these identifiers provide a better uniqueness guarantee than sequence generators, which are only unique within a single database. uuidデータ型は、RFC 4122:、ISO/IEC 9834-8:2005および関連する標準に従う、汎用一意識別子(UUID)を格納します。 (一部のシステムでは、このデータ型をグローバル一意識別子(GUID)と呼んでいます。) この識別子は、同一のアルゴリズムを使用しても既知の世界上の他の誰かが同一識別子が生成される可能性がほとんどないように選択されたアルゴリズムで生成された128ビット量の値です。 したがって、分散システムにおいて、これら識別子は、単一データベース内でしか一意にならないシーケンスジェネレータよりも優れた一意性保証を提供します。

A UUID is written as a sequence of lower-case hexadecimal digits, in several groups separated by hyphens, specifically a group of 8 digits followed by three groups of 4 digits followed by a group of 12 digits, for a total of 32 digits representing the 128 bits. An example of a UUID in this standard form is: UUIDは、小文字の16進数表記桁の並びをいくつかのグループでハイフンで区切って表現されます。 具体的には、8桁のグループが1つ、4桁のグループが3つ、次いで、12桁のグループが1つとなり、合計32桁で128ビットを表します。 この標準形式のUUIDの例を以下に示します。

a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11

<productname>PostgreSQL</productname> also accepts the following alternative forms for input: use of upper-case digits, the standard format surrounded by braces, omitting some or all hyphens, adding a hyphen after any group of four digits. Examples are: また、PostgreSQLは入力の別形式として、桁を大文字表記したもの、標準形式を中括弧でくくったもの、いくつかまたはすべてのハイフンを省略したもの、4桁ごとのグループの間の任意の箇所にハイフンを付加したものも受け付けます。 以下に例を示します。

A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11
{a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11}
a0eebc999c0b4ef8bb6d6bb9bd380a11
a0ee-bc99-9c0b-4ef8-bb6d-6bb9-bd38-0a11
{a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11}

Output is always in the standard form. 出力は常に標準形式になります。

See <xref linkend="functions-uuid"/> for how to generate a UUID in <productname>PostgreSQL</productname>. PostgreSQLでUUIDを生成する方法は9.14を確認してください。