News for hackers. Stuff that matters.
Re:New UUID Formats by canadiantim on Sunday June 12, 2022 @02:51PM (#31717170)
How would one go about trying to use UUID 7 in a Postgres database / python codebase now?
Re:New UUID Formats by oittaa on Sunday June 12, 2022 @03:43PM (#31717587)
I made a simple Python test library that extends the standard UUID class with UUIDv6 and UUIDv7. You might want to check it out. https://github.com/oittaa/uuid6-python

The official UUID Draft repository has also some alternatives if you'd like to check those out. https://github.com/uuid6/prototypes

Postgres supports UUIDs with any version number natively so you can then do something like this with it:

  create table data (id uuid, firstname varchar(100));
  insert into data (id, firstname) values ('017f21cf-d130-7cc3-98c4-dc0c0c07398f', 'John');
  select * from data;
Re:New UUID Formats by kjmph on Sunday June 12, 2022 @09:30PM (#31719989)
I created a PL/pgSQL function for this purpose. As Starlevel001 mentioned, the UUID format will accept opaque bytes. Perhaps you could find this useful?

https://gist.github.com/kjmph/5bd772b2c2df145aa645b837da7eca...

Re:New UUID Formats by stevesimmons on Monday June 13, 2022 @07:31AM (#31723965)
Re:New UUID Formats by oittaa on Monday June 13, 2022 @07:57AM (#31724191)
Nice to see another implementation which takes a bit different approach. Just for your information, there's now Draft 03 which changes the format a little bit. I kinda liked the arbitrary precision of Draft 02, but the newer one just requires millisecond precision and then basically leaves it up to the implementation how to handle the generation of multiple UUIDs within the same millisecond.

https://github.com/uuid6/prototypes/issues/21

Re:New UUID Formats by Starlevel001 on Sunday June 12, 2022 @06:08PM (#31718739)
Postgres UUIDs are treated as an opaque 8-byte array, you can use anything as long as it's in the textual format.