Re: [PATCH] Implement uuid_version()
José Luis Tallón <jltallon@adv-solutions.net>
From: Jose Luis Tallon <jltallon@adv-solutions.net>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers
<pgsql-hackers@postgresql.org>, Alvaro Herrera <alvherre@2ndquadrant.com>,
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Andres Freund <andres@anarazel.de>, Robert Haas <robertmhaas@gmail.com>,
David Fetter <david@fetter.org>
Date: 2019-07-13T10:00:48Z
Lists: pgsql-hackers
On 13/7/19 8:31, Fabien COELHO wrote: > > Hello Jose, Hello, Fabien Thanks for taking a look > >> Got it, and done. Please find attached a v2 patch with the upgrade >> script included. > > Patch v2 applies cleanly. Compiles cleanly (once running configure > --with-uuid=...). Local make check ok. Doc build ok. > > There are no tests, I'd suggest to add some under sql & change > expected if possible which would return all possible values, including > with calling pg_random_uuid() which should return 4. > > Documentation describes uuid_version(), should it not describe > uuid_version(namespace uuid)? > > I'd suggest to add an example. > > The extension update script seems ok, but ISTM that > "uuid-ossp-1.1.sql" should be replaced with an updated > "uuid-ossp-1.2.sql". > This was a quite naïf approach to the issue on my part, more a "scratch my own itch" than anything else.... but definitively sparked some interest. Thanks to all involved. Considering the later arguments on-list, I plan on submitting a more elaborate patchset integrating the feedback received so far, and along the following lines: - uuid type, v4 generation and uuid_version() in core - Provide a means to rename/supercede extensions keeping backwards compatibility (i.e. uuid-ossp -> uuid, keep old code working) - Miscellaneous other functionality - Drop "dead" code ...but I've tried to keep quiet so as not to disturb too much around release time. I intend to continue working on this in late July, aiming for the following commitfest (once more "urgent" patches will have landed) Thanks again. J.L.
Commits
-
Add gen_random_uuid function
- 5925e5549890 13.0 landed
-
Add a 64-bit hash function for type hstore.
- eb6f29141bed 12.0 cited