pgsql: Add data type oid8, 64-bit unsigned identifier - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Add data type oid8, 64-bit unsigned identifier
Date
Msg-id E1vdJS7-0050ga-1o@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Add data type oid8, 64-bit unsigned identifier
List pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b139bd3b6ef000ab5d00dd47128e366a726da5f9

Modified Files
--------------
doc/src/sgml/datatype.sgml                |  16 +-
doc/src/sgml/func/func-aggregate.sgml     |   8 +-
src/backend/access/nbtree/nbtcompare.c    |  82 +++++++
src/backend/bootstrap/bootstrap.c         |   2 +
src/backend/utils/adt/Makefile            |   1 +
src/backend/utils/adt/int8.c              |   8 +
src/backend/utils/adt/meson.build         |   1 +
src/backend/utils/adt/oid8.c              | 168 ++++++++++++++
src/fe_utils/print.c                      |   1 +
src/include/c.h                           |  10 +-
src/include/catalog/catversion.h          |   2 +-
src/include/catalog/pg_aggregate.dat      |   6 +
src/include/catalog/pg_amop.dat           |  23 ++
src/include/catalog/pg_amproc.dat         |  12 +
src/include/catalog/pg_cast.dat           |  14 ++
src/include/catalog/pg_opclass.dat        |   4 +
src/include/catalog/pg_operator.dat       |  26 +++
src/include/catalog/pg_opfamily.dat       |   4 +
src/include/catalog/pg_proc.dat           |  64 ++++++
src/include/catalog/pg_type.dat           |   5 +
src/include/fmgr.h                        |   2 +
src/include/postgres.h                    |  20 ++
src/test/regress/expected/hash_func.out   |  10 +
src/test/regress/expected/oid8.out        | 368 ++++++++++++++++++++++++++++++
src/test/regress/expected/opr_sanity.out  |   7 +
src/test/regress/expected/type_sanity.out |   1 +
src/test/regress/parallel_schedule        |   2 +-
src/test/regress/sql/hash_func.sql        |   7 +
src/test/regress/sql/oid8.sql             |  87 +++++++
src/test/regress/sql/type_sanity.sql      |   1 +
30 files changed, 953 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: pgsql: Clean up ICU includes.
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Add data type oid8, 64-bit unsigned identifier