[PATCH] pgcrypto: implement gen_random_uuid

From: Oskari Saarenmaa <os(at)ohmu(dot)fi>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] pgcrypto: implement gen_random_uuid
Date: 2014-01-09 20:34:10
Message-ID: 52CF07C2.3080101@ohmu.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-pgcrypto-implement-gen_random_uuid.patch text/x-patch 14.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-01-09 20:36:55 Re: [BUG] Archive recovery failure on 9.3+.
Previous Message Heikki Linnakangas 2014-01-09 20:32:33 Re: [BUG] Archive recovery failure on 9.3+.