Re: UUID with variable length - Mailing list pgsql-general

From Stephen Frost
Subject Re: UUID with variable length
Date
Msg-id 20201016153352.GN19056@tamriel.snowman.net
Whole thread Raw
In response to Re: UUID with variable length  (Christophe Pettus <xof@thebuild.com>)
List pgsql-general
Greetings,

* Christophe Pettus (xof@thebuild.com) wrote:
> > On Oct 15, 2020, at 13:49, Dirk Krautschick <Dirk.Krautschick@trivadis.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.

Surely a bytea would be better and be less overhead than storing it as
text..

Thanks,

Stephen

Attachment

pgsql-general by date:

Previous
From: Jean-Marc Lessard
Date:
Subject: RE: Does the work made by vaccum in the current pass is lost when interrupted?
Next
From: Alvaro Herrera
Date:
Subject: Re: UUID with variable length