pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?
5+ messages / 4 participants
[nested] [flat]

* pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?
@ 2018-02-06 12:42  Thiemo Kellner <thiemo@gelassene-pferde.biz>
  0 siblings, 2 replies; 5+ messages in thread

From: Thiemo Kellner @ 2018-02-06 12:42 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>

Hi all

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?

Kind regards

Thiemo

-- 
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?
@ 2018-02-06 13:53  Adam Brusselback <adambrusselback@gmail.com>
  parent: Thiemo Kellner <thiemo@gelassene-pferde.biz>
  1 sibling, 1 reply; 5+ messages in thread

From: Adam Brusselback @ 2018-02-06 13:53 UTC (permalink / raw)
  To: Thiemo Kellner <thiemo@gelassene-pferde.biz>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>

In my testing, gen_random_uuid() is quite a bit faster than uuid_generate_v4().




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?
@ 2018-02-06 14:21  Thiemo Kellner, NHC Barhufpflege <thiemo.kellner@gelassene-pferde.biz>
  parent: Adam Brusselback <adambrusselback@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Thiemo Kellner, NHC Barhufpflege @ 2018-02-06 14:21 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>

> In my testing, gen_random_uuid() is quite a bit faster than  
> uuid_generate_v4().

Thx for sharing your experience.


-- 
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?
@ 2018-02-06 14:56  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Thiemo Kellner <thiemo@gelassene-pferde.biz>
  1 sibling, 1 reply; 5+ messages in thread

From: Tom Lane @ 2018-02-06 14:56 UTC (permalink / raw)
  To: Thiemo Kellner <thiemo@gelassene-pferde.biz>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>

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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()?
@ 2018-02-06 15:22  Thiemo Kellner, NHC Barhufpflege <thiemo.kellner@gelassene-pferde.biz>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Thiemo Kellner, NHC Barhufpflege @ 2018-02-06 15:22 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>

Zitat von Tom Lane <tgl@sss.pgh.pa.us>:

> 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.

Thanks for the light :-)

Kind regards Thiemo


-- 
Öffentlicher PGP-Schlüssel:  
http://pgp.mit.edu/pks/lookup?op=get&search=0x8F70EFD2D972CBEF

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-02-06 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-06 12:42 pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()? Thiemo Kellner <thiemo@gelassene-pferde.biz>
2018-02-06 13:53 ` Adam Brusselback <adambrusselback@gmail.com>
2018-02-06 14:21   ` Thiemo Kellner, NHC Barhufpflege <thiemo.kellner@gelassene-pferde.biz>
2018-02-06 14:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-02-06 15:22   ` Thiemo Kellner, NHC Barhufpflege <thiemo.kellner@gelassene-pferde.biz>

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