The data type <type>uuid</type> stores Universally Unique Identifiers
(UUID) as defined by <ulink url="https://datatracker.ietf.org/doc/html/rfc9562">RFC 9562</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.
《マッチ度[92.807746]》uuid
データ型は、RFC 4122:、ISO/IEC 9834-8:2005および関連する標準に従う、汎用一意識別子(UUID)を格納します。
(一部のシステムでは、このデータ型をグローバル一意識別子(GUID)と呼んでいます。)
この識別子は、同一のアルゴリズムを使用しても既知の世界上の他の誰かが同一識別子が生成される可能性がほとんどないように選択されたアルゴリズムで生成された128ビット量の値です。
したがって、分散システムにおいて、これら識別子は、単一データベース内でしか一意にならないシーケンスジェネレータよりも優れた一意性保証を提供します。
RFC 9562 defines 8 different UUID versions. Each version has specific requirements
for generating new UUID values, and each version provides distinct benefits and drawbacks.
<productname>PostgreSQL</productname> provides native support for generating UUIDs
using the UUIDv4 and UUIDv7 algorithms. Alternatively, UUID values can be generated
outside of the database using any algorithm. The data type <type>uuid</type> can be used
to store any UUID, regardless of the origin and the UUID version.
《機械翻訳》RFC 9562では、8つの異なるUUIDバージョンが定義されています。
各バージョンには、新しいUUID値を生成するための固有の要件があり、各バージョンには明確な利点と欠点があります。
PostgreSQLUUIDv4およびUUIDv7アルゴリズムを使用してUUIDを生成するネイティブサポートを提供します。
または、任意のアルゴリズムを使用してデータベースの外でUUID値を生成することもできます。
オリジンやUUIDバージョンに関係なく、データタイプUUID
を使用して任意のUUIDを格納できます。
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を確認してください。