Re: [PATCH] Implement uuid_version()

From: Jose Luis Tallon <jltallon(at)adv-solutions(dot)net>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>
Subject: Re: [PATCH] Implement uuid_version()
Date: 2019-07-13 10:00:48
Message-ID: 6d26a004-e8c7-af33-5cce-94180fb0d46f@adv-solutions.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-07-13 10:25:51 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Michael Paquier 2019-07-13 07:53:45 Re: Comment fix of config_default.pl