[PATCH] pgcrypto: implement gen_random_uuid - Mailing list pgsql-hackers

From Oskari Saarenmaa
Subject [PATCH] pgcrypto: implement gen_random_uuid
Date
Msg-id 52CF07C2.3080101@ohmu.fi
Whole thread Raw
Responses Re: pgcrypto: implement gen_random_uuid  (Wim Lewis <wiml@omnigroup.com>)
Re: [PATCH] pgcrypto: implement gen_random_uuid  (Emre Hasegeli <emre@hasegeli.com>)
List pgsql-hackers
The only useful feature of the uuid-ossp module in my opinion is the
uuid_generate_v4 function and as uuid-ossp is more or less abandonware
people have had trouble building and installing it.  This patch
implements an alternative uuid v4 generation function in pgcrypto which
could be moved to core once there's a core PRNG with large enough
internal state.

On my test system it took 3796 msec to generate a million UUIDs with
pgcrypto while uuid-ossp took 20375 msec.

https://github.com/saaros/postgres/compare/pgcrypto-uuid-v4

  contrib/pgcrypto/Makefile                                 |  2 +-
  contrib/pgcrypto/pgcrypto--1.0--1.1.sql                   |  8 ++++++++
  contrib/pgcrypto/{pgcrypto--1.0.sql => pgcrypto--1.1.sql} |  7 ++++++-
  contrib/pgcrypto/pgcrypto.c                               | 22
++++++++++++++++++++++
  contrib/pgcrypto/pgcrypto.control                         |  2 +-
  contrib/pgcrypto/pgcrypto.h                               |  1 +
  doc/src/sgml/pgcrypto.sgml                                | 11 +++++++++++

/ Oskari

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: [BUG] Archive recovery failure on 9.3+.
Next
From: Tom Lane
Date:
Subject: Re: [BUG] Archive recovery failure on 9.3+.