Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 9b6cc37ce608401d44f6535a0c7cb777 > files > 191

postgresql11-docs-11.5-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>8.12. UUID Type</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="datatype-textsearch.html" title="8.11. Text Search Types" /><link rel="next" href="datatype-xml.html" title="8.13. XML Type" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">8.12. <acronym xmlns="http://www.w3.org/1999/xhtml" class="acronym">UUID</acronym> Type</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="datatype-textsearch.html" title="8.11. Text Search Types">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="datatype.html" title="Chapter 8. Data Types">Up</a></td><th width="60%" align="center">Chapter 8. Data Types</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 11.5 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="datatype-xml.html" title="8.13. XML Type">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="DATATYPE-UUID"><div class="titlepage"><div><div><h2 class="title" style="clear: both">8.12. <acronym class="acronym">UUID</acronym> Type</h2></div></div></div><a id="id-1.5.7.20.2" class="indexterm"></a><p>
    The data type <code class="type">uuid</code> stores Universally Unique Identifiers
    (UUID) as defined by RFC 4122, ISO/IEC 9834-8:2005, and related standards.
    (Some systems refer to this data type as a globally unique identifier, or
    GUID,<a id="id-1.5.7.20.3.2" class="indexterm"></a> 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.
   </p><p>
    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:
</p><pre class="programlisting">
a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
</pre><p>
    <span class="productname">PostgreSQL</span> 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:
</p><pre class="programlisting">
A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11
{a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11}
a0eebc999c0b4ef8bb6d6bb9bd380a11
a0ee-bc99-9c0b-4ef8-bb6d-6bb9-bd38-0a11
{a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11}
</pre><p>
    Output is always in the standard form.
   </p><p>
    <span class="productname">PostgreSQL</span> provides storage and comparison
    functions for UUIDs, but the core database does not include any
    function for generating UUIDs, because no single algorithm is well
    suited for every application.  The <a class="xref" href="uuid-ossp.html" title="F.44. uuid-ossp">uuid-ossp</a> module
    provides functions that implement several standard algorithms.
    The <a class="xref" href="pgcrypto.html" title="F.25. pgcrypto">pgcrypto</a> module also provides a generation
    function for random UUIDs.
    Alternatively, UUIDs could be generated by client applications or
    other libraries invoked through a server-side function.
   </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="datatype-textsearch.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="datatype.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="datatype-xml.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8.11. Text Search Types </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 8.13. <acronym class="acronym">XML</acronym> Type</td></tr></table></div></body></html>