summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/pgcrypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pgcrypto/pgcrypto.c')
-rw-r--r--contrib/pgcrypto/pgcrypto.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/contrib/pgcrypto/pgcrypto.c b/contrib/pgcrypto/pgcrypto.c
index c5587679098..f69ae107c3a 100644
--- a/contrib/pgcrypto/pgcrypto.c
+++ b/contrib/pgcrypto/pgcrypto.c
@@ -446,20 +446,8 @@ PG_FUNCTION_INFO_V1(pg_random_uuid);
Datum
pg_random_uuid(PG_FUNCTION_ARGS)
{
- uint8 *buf = (uint8 *) palloc(UUID_LEN);
-
- /* Generate random bits. */
- if (!pg_strong_random(buf, UUID_LEN))
- px_THROW_ERROR(PXE_NO_RANDOM);
-
- /*
- * Set magic numbers for a "version 4" (pseudorandom) UUID, see
- * http://tools.ietf.org/html/rfc4122#section-4.4
- */
- buf[6] = (buf[6] & 0x0f) | 0x40; /* "version" field */
- buf[8] = (buf[8] & 0x3f) | 0x80; /* "variant" field */
-
- PG_RETURN_UUID_P((pg_uuid_t *) buf);
+ /* redirect to built-in function */
+ return gen_random_uuid(fcinfo);
}
static void *