pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thiemo Kellner <thiemo@gelassene-pferde.biz>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?
Date: Tue, 06 Feb 2018 09:56:44 -0500
Message-ID: <29828.1517929004@sss.pgh.pa.us> (raw)
In-Reply-To: <20180206134248.16313350klvadi2o@www.gelassene-pferde.biz>
References: <20180206134248.16313350klvadi2o@www.gelassene-pferde.biz>

Thiemo Kellner <thiemo@gelassene-pferde.biz> writes:
> I consider using uuid as primary key type. The documentation of  
> uuid-ossp states  
> (https://www.postgresql.org/docs/10/static/uuid-ossp.html#idm46428633607040)  
> makes a note to consider the pgcrypto function instead but not why.  
> Can somebody shed some light on that matter?

I believe the point of the recommendation is that if you only need type-4
UUIDs, you can get that from pgcrypto without needing the external
dependency of the OSSP UUID library.  This is a bit less urgent than when
that text was written, because now we also support building that contrib
module against some other implementations; but there are still going to
be systems on which installing uuid-ossp is inconvenient.

There may also be a belief that pgcrypto's result is more
cryptographically secure, though I wouldn't swear to that.

			regards, tom lane




view thread (5+ messages)  latest in thread

Message-ID: <29828.1517929004@sss.pgh.pa.us>
Permalink:  ../29828.1517929004@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29828.1517929004@sss.pgh.pa.us

 · 

reply

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, thiemo@gelassene-pferde.biz
  Subject: Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?
  In-Reply-To: <29828.1517929004@sss.pgh.pa.us>
  References: <20180206134248.16313350klvadi2o@www.gelassene-pferde.biz> <29828.1517929004@sss.pgh.pa.us>

* 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