From 4c04be9b05ad2ec5acd27c3417bf075c13cab134 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Tue, 7 Apr 2020 11:33:56 +1200 Subject: 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 Reviewed-by: Takao Fujii Reviewed-by: Yoshikazu Imai Reviewed-by: Mark Dilger Discussion: https://postgr.es/m/20190725000636.666m5mad25wfbrri%40alap3.anarazel.de --- src/test/modules/commit_ts/t/004_restart.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/modules/commit_ts/t') diff --git a/src/test/modules/commit_ts/t/004_restart.pl b/src/test/modules/commit_ts/t/004_restart.pl index bd4b943305..39ca25a06b 100644 --- a/src/test/modules/commit_ts/t/004_restart.pl +++ b/src/test/modules/commit_ts/t/004_restart.pl @@ -45,7 +45,7 @@ my $xid = $node_master->safe_psql( 'postgres', qq[ BEGIN; INSERT INTO committs_test(x, y) VALUES (1, current_timestamp); - SELECT txid_current(); + SELECT pg_current_xact_id()::xid; COMMIT; ]); @@ -93,7 +93,7 @@ DECLARE i int; BEGIN FOR i in 1..cnt LOOP - EXECUTE 'SELECT txid_current()'; + EXECUTE 'SELECT pg_current_xact_id()'; COMMIT; END LOOP; END; @@ -115,7 +115,7 @@ my $xid_disabled = $node_master->safe_psql( 'postgres', qq[ BEGIN; INSERT INTO committs_test(x, y) VALUES (2, current_timestamp); - SELECT txid_current(); + SELECT pg_current_xact_id(); COMMIT; ]); -- cgit v1.2.1