[PATCH] Implement uuid_version()

From: Jose Luis Tallon <jltallon(at)adv-solutions(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] Implement uuid_version()
Date: 2019-04-06 11:57:22
Message-ID: 1baf5fd5-b3aa-d36a-649c-3c2a788515d8@adv-solutions.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


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

... 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.



Attachment Content-Type Size
uuid_version.patch text/x-patch 2.0 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Verite 2019-04-06 13:08:48 Re: Changes to pg_dump/psql following collation "C" in the catalog
Previous Message Pierre Ducroquet 2019-04-06 11:40:27 [Patch] Invalid permission check in pg_stats for functional indexes