Re: UUID v7
Nick Babadzhanian <pgnickb@gmail.com>
From: Nick Babadzhanian <pgnickb@gmail.com>
To: "Andrey M. Borodin" <x4mmm@yandex-team.ru>
Cc: Mat Arye <mat@timescaledb.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
Tom Lane <tgl@sss.pgh.pa.us>, Daniel Gustafsson <daniel@yesql.se>,
Matthias van de Meent <boekewurm+postgres@gmail.com>, Nikolay Samokhvalov <samokhvalov@gmail.com>,
"Kyzer Davis (kydavis)" <kydavis@cisco.com>, Andres Freund <andres@anarazel.de>, Andrey Borodin <amborodin86@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
"brad@peabody.io" <brad@peabody.io>, "wolakk@gmail.com" <wolakk@gmail.com>, sergeyprokhorenko@yahoo.com.au
Date: 2023-10-09T16:46:17Z
Lists: pgsql-hackers
On Thu, 31 Aug 2023 at 23:10, Andrey M. Borodin <x4mmm@yandex-team.ru> wrote: > Well, as far as I know, RFC discourages extracting timestamps from UUIDs. But we still can have such functions...maybe as an extension? Do you know of any reason for that? > However, so far I haven't figured out how to implement optional arguments for catalog functions. I'd appreciate any pointers here. I'd argue that the time argument shouldn't be optional. Asking the user to supply time would force them to think whether they want to go with `now()` or `clock_timestamp()` or something else. Also, a shameless plug with my extension for UUID v1 that implements extract and create from (and an opclass): https://github.com/pgnickb/uuid_v1_ops
Commits
-
Fix timestamp overflow in UUIDv7 implementation.
- a5419bc72e22 18.0 landed
-
Add UUID version 7 generation function.
- 78c5e141e9c1 18.0 landed
-
Add some UUID support functions
- 794f10f6b920 17.0 landed