Re: UUID with variable length

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Dirk Krautschick <Dirk(dot)Krautschick(at)trivadis(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: UUID with variable length
Date: 2020-10-15 21:12:00
Message-ID: 75B2C23E-3730-4BB1-ADEB-33DFC1976928@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Oct 15, 2020, at 13:49, Dirk Krautschick <Dirk(dot)Krautschick(at)trivadis(dot)com> wrote:
> Or do you have some other ideas how to use a primary key datatype like UUID but with variable length?

You're probably best off storing it as a VARCHAR() with a check constraint or constraint trigger that validates it.

--
-- Christophe Pettus
xof(at)thebuild(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-10-16 00:59:39 Re: Date Format 9999-12-31-00.00.00.000000
Previous Message Dirk Krautschick 2020-10-15 20:58:13 Date Format 9999-12-31-00.00.00.000000