Re: [PATCH] Implement uuid_version() - Mailing list pgsql-hackers

From Ian Barwick
Subject Re: [PATCH] Implement uuid_version()
Date
Msg-id d3b99933-da2b-8ea4-20f4-996f91052534@2ndquadrant.com
Whole thread Raw
In response to Re: [PATCH] Implement uuid_version()  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On 7/14/19 9:40 PM, Peter Eisentraut wrote:
> On 2019-07-13 17:13, Fabien COELHO wrote:
>>>> What about avoiding a redirection with something like:
>>>>
>>>> Datum (* const pg_random_uuid)(PG_FUNCTION_ARGS) = gen_random_uuid;
>>>
>>> That seems very confusing.
>>
>> Dunno. Possibly. The user does not have to look at the implementation, and
>> probably such code would deserve a comment.
>>
>> The point is to avoid one call so as to perform the same (otherwise the
>> pg_random_uuid would be slightly slower), and to ensure that it behaves
>> the same, as it would be the very same function by construction.
>>
>> I've switched the patch to ready anyway.
> 
> committed

Small doc tweak suggestion - the pgcrypto docs [1] now say about gen_random_uuid():

     Returns a version 4 (random) UUID. (Obsolete, this function is now also
     included in core PostgreSQL.)

which gives the impression the code contains two versions of this function, the core
one and an obsolete one in pgcrypto. Per the commit message the situation is actually:

     The pgcrypto implementation now internally redirects to the built-in one.

Suggested wording improvement in the attached patch.

[1] https://www.postgresql.org/docs/devel/pgcrypto.html#id-1.11.7.34.9


Regards

Ian Barwick

-- 
  Ian Barwick                   https://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Re: SQL/JSON: functions
Next
From: Thomas Munro
Date:
Subject: Re: Commitfest 2019-07, the first of five* for PostgreSQL 13