pgsql: Introduce xid8-based functions to replace txid_XXX. - Mailing list pgsql-committers

From Thomas Munro
Subject pgsql: Introduce xid8-based functions to replace txid_XXX.
Date
Msg-id E1jLbsR-00027A-6J@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Introduce xid8-based functions to replace txid_XXX.

The txid_XXX family of fmgr functions exposes 64 bit transaction IDs to
users as int8.  Now that we have an SQL type xid8 for FullTransactionId,
define a new set of functions including pg_current_xact_id() and
pg_current_snapshot() based on that.  Keep the old functions around too,
for now.

It's a bit sneaky to use the same C functions for both, but since the
binary representation is identical except for the signedness of the
type, and since older functions are the ones using the wrong signedness,
and since we'll presumably drop the older ones after a reasonable period
of time, it seems reasonable to switch to FullTransactionId internally
and share the code for both.

Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com>
Reviewed-by: Takao Fujii <btfujiitkp@oss.nttdata.com>
Reviewed-by: Yoshikazu Imai <imai.yoshikazu@fujitsu.com>
Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com>
Discussion: https://postgr.es/m/20190725000636.666m5mad25wfbrri%40alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4c04be9b05ad2ec5acd27c3417bf075c13cab134

Modified Files
--------------
contrib/test_decoding/expected/ddl.out             |   2 +-
.../test_decoding/expected/decoding_in_xact.out    |   6 +-
contrib/test_decoding/expected/oldest_xmin.out     |   2 +-
contrib/test_decoding/expected/ondisk_startup.out  |   6 +-
.../test_decoding/expected/snapshot_transfer.out   |   4 +-
contrib/test_decoding/specs/oldest_xmin.spec       |   2 +-
contrib/test_decoding/specs/ondisk_startup.spec    |   4 +-
contrib/test_decoding/specs/snapshot_transfer.spec |   2 +-
contrib/test_decoding/sql/ddl.sql                  |   2 +-
contrib/test_decoding/sql/decoding_in_xact.sql     |   6 +-
doc/src/sgml/datatype.sgml                         |   8 +-
doc/src/sgml/func.sgml                             | 166 ++++++--
doc/src/sgml/logicaldecoding.sgml                  |   2 +-
doc/src/sgml/monitoring.sgml                       |   2 +-
src/backend/utils/adt/Makefile                     |   2 +-
src/backend/utils/adt/{txid.c => xid8funcs.c}      | 424 +++++++++------------
src/include/catalog/catversion.h                   |   2 +-
src/include/catalog/pg_proc.dat                    |  69 +++-
src/include/catalog/pg_type.dat                    |   5 +
src/test/modules/commit_ts/t/004_restart.pl        |   6 +-
.../test_ddl_deparse/expected/create_table.out     |   2 +-
.../modules/test_ddl_deparse/sql/create_table.sql  |   2 +-
src/test/recovery/t/003_recovery_targets.pl        |   2 +-
src/test/recovery/t/011_crash_recovery.pl          |  10 +-
src/test/regress/expected/alter_table.out          |   4 +-
src/test/regress/expected/hs_standby_functions.out |   6 +-
src/test/regress/expected/opr_sanity.out           |  11 +-
src/test/regress/expected/txid.out                 |  13 +-
src/test/regress/expected/update.out               |   6 +-
src/test/regress/expected/xid.out                  | 326 ++++++++++++++++
src/test/regress/sql/alter_table.sql               |   4 +-
src/test/regress/sql/hs_standby_functions.sql      |   4 +-
src/test/regress/sql/txid.sql                      |   3 +
src/test/regress/sql/update.sql                    |   6 +-
src/test/regress/sql/xid.sql                       | 104 +++++
src/tools/pgindent/typedefs.list                   |   1 +
36 files changed, 871 insertions(+), 355 deletions(-)


pgsql-committers by date:

Previous
From: Tomas Vondra
Date:
Subject: pgsql: Use INT64_FORMAT when formatting int64 values in explain
Next
From: Tom Lane
Date:
Subject: pgsql: Fix representation of SORT_TYPE_STILL_IN_PROGRESS.