summaryrefslogtreecommitdiff
path: root/src/test/modules/commit_ts/t
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2016-11-24 15:39:55 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2016-11-24 15:39:55 -0300
commit4aaddf2f009821e29aea3735e44332ad9ca47aaa (patch)
tree95273ec49be23d4e2cdffeeeb24f2d4df6464884 /src/test/modules/commit_ts/t
parent6fa391be4e83139cd134d5ccfc1499809bb8c98c (diff)
downloadpostgresql-4aaddf2f009821e29aea3735e44332ad9ca47aaa.tar.gz
Fix commit_ts for FrozenXid and BootstrapXid
Previously, requesting commit timestamp for transactions FrozenTransactionId and BootstrapTransactionId resulted in an error. But since those values can validly appear in committed tuples' Xmin, this behavior is unhelpful and error prone: each caller would have to special-case those values before requesting timestamp data for an Xid. We already have a perfectly good interface for returning "the Xid you requested is too old for us to have commit TS data for it", so let's use that instead. Backpatch to 9.5, where commit timestamps appeared. Author: Craig Ringer Discussion: https://www.postgresql.org/message-id/CAMsr+YFM5Q=+ry3mKvWEqRTxrB0iU3qUSRnS28nz6FJYtBwhJg@mail.gmail.com
Diffstat (limited to 'src/test/modules/commit_ts/t')
-rw-r--r--src/test/modules/commit_ts/t/004_restart.pl14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/test/modules/commit_ts/t/004_restart.pl b/src/test/modules/commit_ts/t/004_restart.pl
index 900e9b7970..32be07c741 100644
--- a/src/test/modules/commit_ts/t/004_restart.pl
+++ b/src/test/modules/commit_ts/t/004_restart.pl
@@ -25,19 +25,13 @@ like(
($ret, $stdout, $stderr) =
$node_master->psql('postgres', qq[SELECT pg_xact_commit_timestamp('1');]);
-is($ret, 3, 'getting ts of BootstrapTransactionId reports error');
-like(
- $stderr,
- qr/cannot retrieve commit timestamp for transaction/,
- 'expected error from BootstrapTransactionId');
+is($ret, 0, 'getting ts of BootstrapTransactionId succeeds');
+is($stdout, '', 'timestamp of BootstrapTransactionId is null');
($ret, $stdout, $stderr) =
$node_master->psql('postgres', qq[SELECT pg_xact_commit_timestamp('2');]);
-is($ret, 3, 'getting ts of FrozenTransactionId reports error');
-like(
- $stderr,
- qr/cannot retrieve commit timestamp for transaction/,
- 'expected error from FrozenTransactionId');
+is($ret, 0, 'getting ts of FrozenTransactionId succeeds');
+is($stdout, '', 'timestamp of FrozenTransactionId is null');
# Since FirstNormalTransactionId will've occurred during initdb, long before we
# enabled commit timestamps, it'll be null since we have no cts data for it but