Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8073fff

Browse files
committed
Documentation for UUID type
1 parent 1c8302c commit 8073fff

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.196 2007/04/17 17:30:34 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.197 2007/04/20 21:51:46 petere Exp $ -->
22

33
<chapter id="datatype">
44
<title id="datatype-title">Data Types</title>
@@ -234,6 +234,12 @@
234234
<entry>date and time, including time zone</entry>
235235
</row>
236236

237+
<row>
238+
<entry><type>uuid</type></entry>
239+
<entry></entry>
240+
<entry>universally unique identifier</entry>
241+
</row>
242+
237243
<row>
238244
<entry><type>xml</type></entry>
239245
<entry></entry>
@@ -3199,6 +3205,49 @@ SELECT * FROM test;
31993205
</para>
32003206
</sect1>
32013207

3208+
<sect1 id="datatype-uuid">
3209+
<title><acronym>UUID</acronym> Type</title>
3210+
3211+
<indexterm zone="datatype-xml">
3212+
<primary>UUID</primary>
3213+
</indexterm>
3214+
3215+
<para>
3216+
The data type <type>uuid</type> stores Universally Unique
3217+
Identifiers (UUID) as per RFC 4122, ISO/IEC 9834-8:2005, and
3218+
related standards. (Some systems refer to this data type as
3219+
globally unique
3220+
identifier/GUID<indexterm><primary>GUID</primary></indexterm>
3221+
instead.) Such an identifier is a 128-bit quantity that is
3222+
generated by a suitable algorithm so that it is very unlikely to
3223+
be generated by anyone else in the known universe using the same
3224+
algorithm. Therefore, for distributed systems, these identifiers
3225+
provide a better uniqueness guarantee than that which can be
3226+
achieved using sequence generators, which are only unique within a
3227+
single database.
3228+
</para>
3229+
3230+
<para>
3231+
A UUID is written as a sequence of lower-case hexadecimal digits,
3232+
in several groups separated by hyphens, specifically a group of 8
3233+
digits followed by three groups of 4 digits followed by a group of
3234+
12 digits, for a total of 32 digits representing the 128 bits. An
3235+
example of a UUID in this standard form is:
3236+
<programlisting>
3237+
a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
3238+
</programlisting>
3239+
PostgreSQL also accepts the following alternative forms for input:
3240+
use of upper-case digits, the standard format surrounded by
3241+
braces, and omitting the hyphens. Examples are:
3242+
<programlisting>
3243+
A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11
3244+
{a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11}
3245+
a0eebc999c0b4ef8bb6d6bb9bd380a11
3246+
</programlisting>
3247+
Output is always in the standard form.
3248+
</para>
3249+
</sect1>
3250+
32023251
<sect1 id="datatype-xml">
32033252
<title><acronym>XML</> Type</title>
32043253

0 commit comments

Comments
 (0)