pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Introduce xid8-based functions to replace txid_XXX.
Date: Tue, 07 Apr 2020 00:14:03 +0000
Message-ID: <E1jLbsR-00027A-6J@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1jLbsR-00027A-6J@gemulon.postgresql.org>
Permalink:  ../E1jLbsR-00027A-6J@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jLbsR-00027A-6J@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org
  Subject: Re: pgsql: Introduce xid8-based functions to replace txid_XXX.
  In-Reply-To: <E1jLbsR-00027A-6J@gemulon.postgresql.org>
  References: <E1jLbsR-00027A-6J@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox