]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Record range constructor functions in pg_range
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 22 Jan 2026 14:17:12 +0000 (15:17 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 22 Jan 2026 14:56:29 +0000 (15:56 +0100)
commitc257ba83971892723c5c89955ab0dd1ef7c077d8
treea8a63bcc844564e1f978d0df49ef5324113cb3a9
parenta5b40d156edaafa4fe93cdae96592f26bc865bd3
Record range constructor functions in pg_range

When a range type is created, several construction functions are also
created, two for the range type and three for the multirange type.
These have an internal dependency, so they "belong" to the range type.
But there was no way to identify those functions when given a range
type.  An upcoming patch needs access to the two- or possibly the
three-argument range constructor function for a given range type.  The
only way to do that would be with fragile workarounds like matching
names and argument types.  The correct way to do that kind of thing is
to record to the links in the system catalogs.  This is what this
patch does, it records the OIDs of these five constructor functions in
the pg_range catalog.  (Currently, there is no code that makes use of
this.)

Reviewed-by: Paul A Jungwirth <pj@illuminatedcomputing.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://www.postgresql.org/message-id/7d63ddfa-c735-4dfe-8c7a-4f1e2a621058%40eisentraut.org
doc/src/sgml/catalogs.sgml
src/backend/catalog/pg_range.c
src/backend/commands/typecmds.c
src/include/catalog/catversion.h
src/include/catalog/pg_range.dat
src/include/catalog/pg_range.h
src/test/regress/expected/oidjoins.out
src/test/regress/expected/type_sanity.out
src/test/regress/sql/type_sanity.sql