Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTRk4-0007b8-LN for pgsql-general@arkaria.postgresql.org; Fri, 16 Oct 2020 15:34:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kTRk1-00084q-Up for pgsql-general@arkaria.postgresql.org; Fri, 16 Oct 2020 15:34:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTRk1-000837-5o for pgsql-general@lists.postgresql.org; Fri, 16 Oct 2020 15:34:01 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kTRju-0004pM-UZ for pgsql-general@lists.postgresql.org; Fri, 16 Oct 2020 15:34:00 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 31A8E5F799; Fri, 16 Oct 2020 11:33:53 -0400 (EDT) Date: Fri, 16 Oct 2020 11:33:53 -0400 From: Stephen Frost To: Christophe Pettus Cc: Dirk Krautschick , "pgsql-general@lists.postgresql.org" Subject: Re: UUID with variable length Message-ID: <20201016153352.GN19056@tamriel.snowman.net> References: <75B2C23E-3730-4BB1-ADEB-33DFC1976928@thebuild.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6yHiY5vv/BiPjcMt" Content-Disposition: inline In-Reply-To: <75B2C23E-3730-4BB1-ADEB-33DFC1976928@thebuild.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --6yHiY5vv/BiPjcMt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Christophe Pettus (xof@thebuild.com) wrote: > > On Oct 15, 2020, at 13:49, Dirk Krautschick wrote: > > Or do you have some other ideas how to use a primary key datatype like = UUID but with variable length? >=20 > You're probably best off storing it as a VARCHAR() with a check constrain= t or constraint trigger that validates it. Surely a bytea would be better and be less overhead than storing it as text.. Thanks, Stephen --6yHiY5vv/BiPjcMt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJfib1gAAoJEO1sijiDR2RVaNwP/RwM7tayRxAWlUPZp+CikhLA aa39zT2FMSMIzDW48sPBG7fjZLjWstAksz8wjANWJu/ANTTSqdk5bHIcbA9g1xHn xGQ6JTat5ASjoy8K1To1r0qO7kjFgIT4Zq54XSZa5l50S1BhTrAiP9aYud85FPUU TPLZTKjg64zMrMxyIV7P8Zg8/yJPHnaIi370b2iJEzx9ItD9dQb/wI/LF+5FKOBZ 80BecBb316q6fHlPBGnCAL7EsQUm4o30t+2hlQQeNL2eU0qf/L4vir2eFo7juRnl j2PUcqjFHY97PAm8OVa1Q5UPJ8ICHxdMdgJfg5BSppNpMRWmyhzPymGmPaTFCjVb pfa/9S867S3yJtDrAkU5skVZQJEPHcZKId0Ui97LotzZUV3WqeWLQtBeeqqXD8se HodLVDE/YOk3AhvCKzO1T4vEwQJgaUPxJgYHZVxt2pO2Z0xf8mwphtd5chxboAbZ ufSjclAC1cE9Qm5KYy7uaBXqdfSm9EfpR7eqXboCvZJeS1nQeFkdqq5xKchMZa6d YpG36AGryU++Zk1Fp4nY1S3Mtqx8X2IU9kqQ0oRiL8wZehJ5Jlxc+YpQSPqoOukU LILCxvLhKJZef5VSAhdGqCX7or1BZ5bhyaa+oPrj7ozAte1fKPUJpCD+n9tsCoZF R4lf1xXUsT4VlNvK/xCw =LaBK -----END PGP SIGNATURE----- --6yHiY5vv/BiPjcMt--