Support UUIDv6 in uuid_extract_timestamp().

Previously, uuid_extract_timestamp() returned NULL for UUIDv6 values,
even though it already extracted timestamps from UUIDv1 and
UUIDv7.

This commit adds a UUIDv6 branch that reassembles the timestamp from
that layout and then converts it exactly as the UUIDv1 branch does. We
provide no uuidv6() generator, but such values can be produced by
client applications and stored in the database, just as UUIDv1 values
already are.

Author: Tristan Partin <[email protected]>
Reviewed-by: MiƂosz Bieniek <[email protected]>
Reviewed-by: Masahiko Sawada <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/451871b740d7ad252b8aeaf16a20bcf831a39254

Modified Files
--------------
doc/src/sgml/func/func-uuid.sgml   |  2 +-
src/backend/utils/adt/uuid.c       | 17 +++++++++++++++++
src/test/regress/expected/uuid.out |  6 ++++++
src/test/regress/sql/uuid.sql      |  1 +
4 files changed, 25 insertions(+), 1 deletion(-)

Reply via email to