|
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 $ --> |
2 | 2 |
|
3 | 3 | <chapter id="datatype">
|
4 | 4 | <title id="datatype-title">Data Types</title>
|
|
234 | 234 | <entry>date and time, including time zone</entry>
|
235 | 235 | </row>
|
236 | 236 |
|
| 237 | + <row> |
| 238 | + <entry><type>uuid</type></entry> |
| 239 | + <entry></entry> |
| 240 | + <entry>universally unique identifier</entry> |
| 241 | + </row> |
| 242 | + |
237 | 243 | <row>
|
238 | 244 | <entry><type>xml</type></entry>
|
239 | 245 | <entry></entry>
|
@@ -3199,6 +3205,49 @@ SELECT * FROM test;
|
3199 | 3205 | </para>
|
3200 | 3206 | </sect1>
|
3201 | 3207 |
|
| 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 | + |
3202 | 3251 | <sect1 id="datatype-xml">
|
3203 | 3252 | <title><acronym>XML</> Type</title>
|
3204 | 3253 |
|
|
0 commit comments