]> granicus.if.org Git - postgresql/commit
Add gen_random_uuid function
authorPeter Eisentraut <peter@eisentraut.org>
Sun, 14 Jul 2019 12:30:27 +0000 (14:30 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Sun, 14 Jul 2019 12:30:27 +0000 (14:30 +0200)
commit5925e5549890416bcf588334d9d0bc99f8ad6c7f
tree0b9d6556f5e4dcaa389d2f35cf60804645d2c5f8
parent565f3390005318ea4c982b8d054d56e9fe5a6454
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
contrib/pgcrypto/pgcrypto.c
doc/src/sgml/datatype.sgml
doc/src/sgml/func.sgml
doc/src/sgml/pgcrypto.sgml
doc/src/sgml/uuid-ossp.sgml
src/backend/utils/adt/uuid.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat
src/test/regress/expected/opr_sanity.out
src/test/regress/expected/uuid.out
src/test/regress/sql/uuid.sql