3 ms·
An additional thing I learned when I worked on a ulid alternative over the weekend[0] is: Postgres's internal Datum type is at most 64 bits which means every uu
by K0nserv 10mo ago
An additional thing I learned when I worked on a ulid alternative over the weekend[0] is: Postgres's internal Datum type is at most 64 bits which means every uuid requires heap allocation[1] (at least until we get 128 bit machines).
0: https://bsky.app/profile/hugotunius.se/post/3m7wvfokrus2g https://bsky.app/profile/hugotunius.se/post/3m7wvfokrus2g
1: https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/uuid.c#L180-L189 https://github.com/postgres/postgres/blob/master/src/backend...
- qntmfred 10mo agoyou may be interested in this postgres extension as well https://github.com/blitss/typeid-postgres https://github.com/blitss/typeid-postgres
- K0nserv 10mo agoThat is indeed interesting. I have slightly different goals for my version. I want everything to fit in 128 bits so I'm sacrificing some of the random bits, I'm also making sure the representation inside Postgres is also exactly 128 bits. My initial version ended up using CBOR encoding and being 160 bits. Mine dedicates 16 bits for the prefix allowing up to 3 characters (a-z alphabet).
- K0nserv 10mo agoFinished an initial version of mine https://github.com/k0nserv/plid https://github.com/k0nserv/plid