]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Allow explicit casting between bytea and uuid.
authorMasahiko Sawada <msawada@postgresql.org>
Thu, 19 Mar 2026 20:51:50 +0000 (13:51 -0700)
committerMasahiko Sawada <msawada@postgresql.org>
Thu, 19 Mar 2026 20:51:50 +0000 (13:51 -0700)
commitba21f5bf8aff277aa1659a51d26109e0914df182
treeec87f51a9d300d7f76f5422b2c7685357f75d10a
parent1811f1af98fb237fdd5adb588cd4b57c433b75f8
Allow explicit casting between bytea and uuid.

This enables the use of functions such as encode() and decode() with
UUID values, allowing them to be converted to and from alternative
formats like base64 or hex.

The cast maps the 16-byte internal representation of a UUID directly
to a bytea datum. This is more efficient than going through a text
forepresentation.

Bump catalog version.

Author: Dagfinn Ilmari MannsÃ¥ker <ilmari@ilmari.org>
Co-authored-by: Aleksander Alekseev <aleksander@tigerdata.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl>
Discussion: https://postgr.es/m/CAJ7c6TOramr1UTLcyB128LWMqita1Y7%3Darq3KHaU%3Dqikf5yKOQ%40mail.gmail.com
doc/src/sgml/datatype.sgml
src/backend/utils/adt/bytea.c
src/include/catalog/catversion.h
src/include/catalog/pg_cast.dat
src/include/catalog/pg_proc.dat
src/test/regress/expected/uuid.out
src/test/regress/sql/uuid.sql