From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add gen_random_uuid function
Date: Sun, 14 Jul 2019 12:38:34 +0000
Message-ID: <E1hmdly-0006iJ-Dn@gemulon.postgresql.org> (raw)
Add gen_random_uuid function
This adds a built-in function to generate UUIDs.
PostgreSQL hasn't had a built-in function to generate a UUID yet,
relying on external modules such as uuid-ossp and pgcrypto to provide
one. Now that we have a strong random number generator built-in, we
can easily provide a version 4 (random) UUID generation function.
This patch takes the existing function gen_random_uuid() from pgcrypto
and makes it a built-in function. The pgcrypto implementation now
internally redirects to the built-in one.
Reviewed-by: Fabien COELHO <coelho@cri.ensmp.fr>
Discussion: https://www.postgresql.org/message-id/6a65610c-46fc-2323-6b78-e8086340a325@2ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5925e5549890416bcf588334d9d0bc99f8ad6c7f
Modified Files
--------------
contrib/pgcrypto/pgcrypto.c | 16 ++--------------
doc/src/sgml/datatype.sgml | 12 ++----------
doc/src/sgml/func.sgml | 26 ++++++++++++++++++++++++++
doc/src/sgml/pgcrypto.sgml | 3 ++-
doc/src/sgml/uuid-ossp.sgml | 11 +++--------
src/backend/utils/adt/uuid.c | 20 ++++++++++++++++++++
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 3 +++
src/test/regress/expected/opr_sanity.out | 1 +
src/test/regress/expected/uuid.out | 10 ++++++++++
src/test/regress/sql/uuid.sql | 6 ++++++
11 files changed, 76 insertions(+), 34 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org
Subject: Re: pgsql: Add gen_random_uuid function
In-Reply-To: <E1hmdly-0006iJ-Dn@gemulon.postgresql.org>
References: <E1hmdly-0006iJ-Dn@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox