Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ej4gG-0006Pa-Jz for pgsql-general@arkaria.postgresql.org; Tue, 06 Feb 2018 14:57:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ej4gF-0007DZ-7Y for pgsql-general@arkaria.postgresql.org; Tue, 06 Feb 2018 14:57:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ej4gE-0007DQ-Vr for pgsql-general@lists.postgresql.org; Tue, 06 Feb 2018 14:57:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ej4gA-0004VQ-VC for pgsql-general@lists.postgresql.org; Tue, 06 Feb 2018 14:57:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w16EuiH6029829; Tue, 6 Feb 2018 09:56:44 -0500 From: Tom Lane To: Thiemo Kellner cc: pgsql-general Subject: Re: pgcrypto.gen_random_uuid() or uuid-ossp.uuid_generate_v4()? In-reply-to: <20180206134248.16313350klvadi2o@www.gelassene-pferde.biz> References: <20180206134248.16313350klvadi2o@www.gelassene-pferde.biz> Comments: In-reply-to Thiemo Kellner message dated "Tue, 06 Feb 2018 13:42:48 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29827.1517929004.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 06 Feb 2018 09:56:44 -0500 Message-ID: <29828.1517929004@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thiemo Kellner 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#idm46428633607= 040) = > 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