Re: UUID with variable length

2020-10-16 Thread Alvaro Herrera
On 2020-Oct-15, Dirk Krautschick wrote: > Hi, > > I have here a situation with the usage of UUID. Here the database user > allows UUIDs with less then 16 byte lengths (please don't ask :-) ). > > Of course there are some technical ways to do the filling of the not > used bytes but I hope there i

Re: UUID with variable length

2020-10-16 Thread Stephen Frost
Greetings, * Christophe Pettus (x...@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? > > You're probably best off storing it as a VARCHAR() with a check

Re: UUID with variable length

2020-10-15 Thread Christophe Pettus
> 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? You're probably best off storing it as a VARCHAR() with a check constraint or constraint trigger that validates it. -- -- Christo

UUID with variable length

2020-10-15 Thread Dirk Krautschick
Hi, I have here a situation with the usage of UUID. Here the database user allows UUIDs with less then 16 byte lengths (please don't ask :-) ). Of course there are some technical ways to do the filling of the not used bytes but I hope there is a better solution. This UUID is used as primary Key