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

From Jose Luis Tallon
Subject [PATCH] Implement uuid_version()
Date
Msg-id 1baf5fd5-b3aa-d36a-649c-3c2a788515d8@adv-solutions.net
Whole thread Raw
Responses Re: [PATCH] Implement uuid_version()
List pgsql-hackers
Hackers,

     While working on an application, the need arose to be able 
efficiently differentiate v4/v5 UUIDs (for use in partial indexes, among 
others)

... so please find attached a trivial patch which adds the 
functionality. The "uuid_version_bits()" function (from the test suite?) 
seems quite a bit hackish, apart from inefficient :(


     I'm not sure whether this actually would justify a version bump for 
the OSSP-UUID extension ---a misnomer, BTW, since at least in all the 
systems I have access to, the extension is actually linked against 
libuuid from e2fsutils, but I digress --- or not, given that it doesn't 
change exposed functionality.


     Another matter, which I'd like to propose in a later thread, is 
whether it'd be interesting to include the main UUID functionality 
directly in core, with the remaining functions in ossp-uuid (just like 
it is now, for backwards compatibility): Most current patterns for 
distributed/sharded databases are based on using UUIDs for many PKs.


Thanks,

     J.L.



Attachment

pgsql-hackers by date:

Previous
From: Pierre Ducroquet
Date:
Subject: [Patch] Invalid permission check in pg_stats for functional indexes
Next
From: "Daniel Verite"
Date:
Subject: Re: Changes to pg_dump/psql following collation "C" in the catalog