]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Add data type oid8, 64-bit unsigned identifier
authorMichael Paquier <michael@paquier.xyz>
Wed, 7 Jan 2026 02:37:00 +0000 (11:37 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 7 Jan 2026 02:37:00 +0000 (11:37 +0900)
commitb139bd3b6ef000ab5d00dd47128e366a726da5f9
tree37625548bb6fa073f7d635c4ef411478818547ca
parentaf2d4ca191a4552217eceace21fde6ebc2b85770
Add data type oid8, 64-bit unsigned identifier

This new identifier type provides support for 64-bit unsigned values,
to be used in catalogs, like OIDs.  An advantage of a new data type is
that it becomes easier to grep for it in the code when assigning this
type to a catalog attribute, linking it to dedicated APIs and internal
structures.

The following operators are added in this commit, with dedicated tests:
- Casts with integer types and OID.
- btree and hash operators
- min/max functions.
- C type with related macros and defines, named around "Oid8".

This has been mentioned as useful on its own on the thread to add
support for 64-bit TOAST values, so as it becomes possible to attach
this data type to the TOAST code and catalog definitions.  However, as
this concept can apply to many more areas, it is implemented as its own
independent change.  This is based on a discussion with Andres Freund
and Tom Lane.

Bump catalog version.

Author: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Greg Burd <greg@burd.me>
Reviewed-by: Nikhil Kumar Veldanda <veldanda.nikhilkumar17@gmail.com>
Discussion: https://postgr.es/m/1891064.1754681536@sss.pgh.pa.us
30 files changed:
doc/src/sgml/datatype.sgml
doc/src/sgml/func/func-aggregate.sgml
src/backend/access/nbtree/nbtcompare.c
src/backend/bootstrap/bootstrap.c
src/backend/utils/adt/Makefile
src/backend/utils/adt/int8.c
src/backend/utils/adt/meson.build
src/backend/utils/adt/oid8.c [new file with mode: 0644]
src/fe_utils/print.c
src/include/c.h
src/include/catalog/catversion.h
src/include/catalog/pg_aggregate.dat
src/include/catalog/pg_amop.dat
src/include/catalog/pg_amproc.dat
src/include/catalog/pg_cast.dat
src/include/catalog/pg_opclass.dat
src/include/catalog/pg_operator.dat
src/include/catalog/pg_opfamily.dat
src/include/catalog/pg_proc.dat
src/include/catalog/pg_type.dat
src/include/fmgr.h
src/include/postgres.h
src/test/regress/expected/hash_func.out
src/test/regress/expected/oid8.out [new file with mode: 0644]
src/test/regress/expected/opr_sanity.out
src/test/regress/expected/type_sanity.out
src/test/regress/parallel_schedule
src/test/regress/sql/hash_func.sql
src/test/regress/sql/oid8.sql [new file with mode: 0644]
src/test/regress/sql/type_sanity.sql