aboutsummaryrefslogtreecommitdiff
path: root/src/test/modules/commit_ts
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2020-04-07 11:33:56 +1200
committerThomas Munro <tmunro@postgresql.org>2020-04-07 12:04:32 +1200
commit4c04be9b05ad2ec5acd27c3417bf075c13cab134 (patch)
treea85e0f90b3b5fd059b4155d93f00bf58f54955ca /src/test/modules/commit_ts
parentaeec457de8a8820368e343e791accffe24dc7198 (diff)
downloadpostgresql-4c04be9b05ad2ec5acd27c3417bf075c13cab134.tar.gz
postgresql-4c04be9b05ad2ec5acd27c3417bf075c13cab134.zip
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
Diffstat (limited to 'src/test/modules/commit_ts')
-rw-r--r--src/test/modules/commit_ts/t/004_restart.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/modules/commit_ts/t/004_restart.pl b/src/test/modules/commit_ts/t/004_restart.pl
index bd4b9433056..39ca25a06bf 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;
]);