Re: UUID with variable length

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: Dirk Krautschick <Dirk(dot)Krautschick(at)trivadis(dot)com>, "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-16 15:33:53
Message-ID: 20201016153352.GN19056@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

* Christophe Pettus (xof(at)thebuild(dot)com) wrote:
> > 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.

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

Thanks,

Stephen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2020-10-16 16:09:32 Re: UUID with variable length
Previous Message Jean-Marc Lessard 2020-10-16 12:05:42 RE: Does the work made by vaccum in the current pass is lost when interrupted?