diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:19:15 +0000 |
commit | 6eb9c5a5657d1fe77b55cc261450f3538d35a94d (patch) | |
tree | 657d8194422a5daccecfd42d654b8a245ef7b4c8 /doc/src/sgml/html/uuid-ossp.html | |
parent | Initial commit. (diff) | |
download | postgresql-13-upstream.tar.xz postgresql-13-upstream.zip |
Adding upstream version 13.4.upstream/13.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/src/sgml/html/uuid-ossp.html')
-rw-r--r-- | doc/src/sgml/html/uuid-ossp.html | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/doc/src/sgml/html/uuid-ossp.html b/doc/src/sgml/html/uuid-ossp.html new file mode 100644 index 0000000..53df000 --- /dev/null +++ b/doc/src/sgml/html/uuid-ossp.html @@ -0,0 +1,143 @@ +<?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>F.44. uuid-ossp</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 V1.79.1" /><link rel="prev" href="unaccent.html" title="F.43. unaccent" /><link rel="next" href="xml2.html" title="F.45. xml2" /></head><body id="docContent" class="container-fluid col-10"><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">F.44. uuid-ossp</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="unaccent.html" title="F.43. unaccent">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules">Up</a></td><th width="60%" align="center">Appendix F. Additional Supplied Modules</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="xml2.html" title="F.45. xml2">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="UUID-OSSP"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.44. uuid-ossp</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="uuid-ossp.html#id-1.11.7.53.5">F.44.1. <code class="literal">uuid-ossp</code> Functions</a></span></dt><dt><span class="sect2"><a href="uuid-ossp.html#id-1.11.7.53.6">F.44.2. Building <code class="filename">uuid-ossp</code></a></span></dt><dt><span class="sect2"><a href="uuid-ossp.html#id-1.11.7.53.7">F.44.3. Author</a></span></dt></dl></div><a id="id-1.11.7.53.2" class="indexterm"></a><p> + The <code class="filename">uuid-ossp</code> module provides functions to generate universally + unique identifiers (UUIDs) using one of several standard algorithms. There + are also functions to produce certain special UUID constants. + This module is only necessary for special requirements beyond what is + available in core <span class="productname">PostgreSQL</span>. See <a class="xref" href="functions-uuid.html" title="9.14. UUID Functions">Section 9.14</a> for built-in ways to generate UUIDs. + </p><p> + This module is considered <span class="quote">“<span class="quote">trusted</span>”</span>, that is, it can be + installed by non-superusers who have <code class="literal">CREATE</code> privilege + on the current database. + </p><div class="sect2" id="id-1.11.7.53.5"><div class="titlepage"><div><div><h3 class="title">F.44.1. <code class="literal">uuid-ossp</code> Functions</h3></div></div></div><p> + <a class="xref" href="uuid-ossp.html#UUID-OSSP-FUNCTIONS" title="Table F.32. Functions for UUID Generation">Table F.32</a> shows the functions available to + generate UUIDs. + The relevant standards ITU-T Rec. X.667, ISO/IEC 9834-8:2005, and RFC + 4122 specify four algorithms for generating UUIDs, identified by the + version numbers 1, 3, 4, and 5. (There is no version 2 algorithm.) + Each of these algorithms could be suitable for a different set of + applications. + </p><div class="table" id="UUID-OSSP-FUNCTIONS"><p class="title"><strong>Table F.32. Functions for UUID Generation</strong></p><div class="table-contents"><table class="table" summary="Functions for UUID Generation" border="1"><colgroup><col /></colgroup><thead><tr><th class="func_table_entry"><p class="func_signature"> + Function + </p> + <p> + Description + </p></th></tr></thead><tbody><tr><td class="func_table_entry"><p class="func_signature"> + <a id="id-1.11.7.53.5.3.2.2.1.1.1.1" class="indexterm"></a> + <code class="function">uuid_generate_v1</code> () + → <code class="returnvalue">uuid</code> + </p> + <p> + Generates a version 1 UUID. This involves the MAC + address of the computer and a time stamp. Note that UUIDs of this + kind reveal the identity of the computer that created the identifier + and the time at which it did so, which might make it unsuitable for + certain security-sensitive applications. + </p></td></tr><tr><td class="func_table_entry"><p class="func_signature"> + <a id="id-1.11.7.53.5.3.2.2.2.1.1.1" class="indexterm"></a> + <code class="function">uuid_generate_v1mc</code> () + → <code class="returnvalue">uuid</code> + </p> + <p> + Generates a version 1 UUID, but uses a random multicast + MAC address instead of the real MAC address of the computer. + </p></td></tr><tr><td class="func_table_entry"><p class="func_signature"> + <a id="id-1.11.7.53.5.3.2.2.3.1.1.1" class="indexterm"></a> + <code class="function">uuid_generate_v3</code> ( <em class="parameter"><code>namespace</code></em> <code class="type">uuid</code>, <em class="parameter"><code>name</code></em> <code class="type">text</code> ) + → <code class="returnvalue">uuid</code> + </p> + <p> + Generates a version 3 UUID in the given namespace using + the specified input name. The namespace should be one of the special + constants produced by the <code class="function">uuid_ns_*()</code> functions + shown in <a class="xref" href="uuid-ossp.html#UUID-OSSP-CONSTANTS" title="Table F.33. Functions Returning UUID Constants">Table F.33</a>. (It could be any UUID + in theory.) The name is an identifier in the selected namespace. + </p> + <p> + For example: + +</p><pre class="programlisting"> +SELECT uuid_generate_v3(uuid_ns_url(), 'http://www.postgresql.org'); +</pre><p> + + The name parameter will be MD5-hashed, so the cleartext cannot be + derived from the generated UUID. + The generation of UUIDs by this method has no random or + environment-dependent element and is therefore reproducible. + </p></td></tr><tr><td class="func_table_entry"><p class="func_signature"> + <code class="function">uuid_generate_v4</code> () + → <code class="returnvalue">uuid</code> + </p> + <p> + Generates a version 4 UUID, which is derived entirely + from random numbers. + </p></td></tr><tr><td class="func_table_entry"><p class="func_signature"> + <code class="function">uuid_generate_v5</code> ( <em class="parameter"><code>namespace</code></em> <code class="type">uuid</code>, <em class="parameter"><code>name</code></em> <code class="type">text</code> ) + → <code class="returnvalue">uuid</code> + </p> + <p> + Generates a version 5 UUID, which works like a version 3 + UUID except that SHA-1 is used as a hashing method. Version 5 should + be preferred over version 3 because SHA-1 is thought to be more secure + than MD5. + </p></td></tr></tbody></table></div></div><br class="table-break" /><div class="table" id="UUID-OSSP-CONSTANTS"><p class="title"><strong>Table F.33. Functions Returning UUID Constants</strong></p><div class="table-contents"><table class="table" summary="Functions Returning UUID Constants" border="1"><colgroup><col /></colgroup><thead><tr><th class="func_table_entry"><p class="func_signature"> + Function + </p> + <p> + Description + </p></th></tr></thead><tbody><tr><td class="func_table_entry"><p class="func_signature"> + <code class="function">uuid_nil</code> () + → <code class="returnvalue">uuid</code> + </p> + <p> + Returns a <span class="quote">“<span class="quote">nil</span>”</span> UUID constant, which does not occur as a + real UUID. + </p></td></tr><tr><td class="func_table_entry"><p class="func_signature"> + <code class="function">uuid_ns_dns</code> () + → <code class="returnvalue">uuid</code> + </p> + <p> + Returns a constant designating the DNS namespace for UUIDs. + </p></td></tr><tr><td class="func_table_entry"><p class="func_signature"> + <code class="function">uuid_ns_url</code> () + → <code class="returnvalue">uuid</code> + </p> + <p> + Returns a constant designating the URL namespace for UUIDs. + </p></td></tr><tr><td class="func_table_entry"><p class="func_signature"> + <code class="function">uuid_ns_oid</code> () + → <code class="returnvalue">uuid</code> + </p> + <p> + Returns a constant designating the ISO object identifier (OID) namespace for + UUIDs. (This pertains to ASN.1 OIDs, which are unrelated to the OIDs + used in <span class="productname">PostgreSQL</span>.) + </p></td></tr><tr><td class="func_table_entry"><p class="func_signature"> + <code class="function">uuid_ns_x500</code> () + → <code class="returnvalue">uuid</code> + </p> + <p> + Returns a constant designating the X.500 distinguished name (DN) + namespace for UUIDs. + </p></td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect2" id="id-1.11.7.53.6"><div class="titlepage"><div><div><h3 class="title">F.44.2. Building <code class="filename">uuid-ossp</code></h3></div></div></div><p> + Historically this module depended on the OSSP UUID library, which accounts + for the module's name. While the OSSP UUID library can still be found + at <a class="ulink" href="http://www.ossp.org/pkg/lib/uuid/" target="_top">http://www.ossp.org/pkg/lib/uuid/</a>, it is not well + maintained, and is becoming increasingly difficult to port to newer + platforms. <code class="filename">uuid-ossp</code> can now be built without the OSSP + library on some platforms. On FreeBSD, NetBSD, and some other BSD-derived + platforms, suitable UUID creation functions are included in the + core <code class="filename">libc</code> library. On Linux, macOS, and some other + platforms, suitable functions are provided in the <code class="filename">libuuid</code> + library, which originally came from the <code class="literal">e2fsprogs</code> project + (though on modern Linux it is considered part + of <code class="literal">util-linux-ng</code>). When invoking <code class="filename">configure</code>, + specify <code class="option">--with-uuid=bsd</code> to use the BSD functions, + or <code class="option">--with-uuid=e2fs</code> to + use <code class="literal">e2fsprogs</code>' <code class="filename">libuuid</code>, or + <code class="option">--with-uuid=ossp</code> to use the OSSP UUID library. + More than one of these libraries might be available on a particular + machine, so <code class="filename">configure</code> does not automatically choose one. + </p></div><div class="sect2" id="id-1.11.7.53.7"><div class="titlepage"><div><div><h3 class="title">F.44.3. Author</h3></div></div></div><p> + Peter Eisentraut <code class="email"><<a class="email" href="mailto:peter_e@gmx.net">peter_e@gmx.net</a>></code> + </p></div></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="unaccent.html" title="F.43. unaccent">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="xml2.html" title="F.45. xml2">Next</a></td></tr><tr><td width="40%" align="left" valign="top">F.43. unaccent </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 13.4 Documentation">Home</a></td><td width="40%" align="right" valign="top"> F.45. xml2</td></tr></table></div></body></html>
\ No newline at end of file |