mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Fix commit_ts test suite for systems with coarse timestamp granularity.
Noticed on a couple of Windows configurations. Petr Jelinek, reviewed by Michael Paquier.
This commit is contained in:
@ -13,7 +13,7 @@ INSERT INTO committs_test DEFAULT VALUES;
|
|||||||
INSERT INTO committs_test DEFAULT VALUES;
|
INSERT INTO committs_test DEFAULT VALUES;
|
||||||
SELECT id,
|
SELECT id,
|
||||||
pg_xact_commit_timestamp(xmin) >= ts,
|
pg_xact_commit_timestamp(xmin) >= ts,
|
||||||
pg_xact_commit_timestamp(xmin) < now(),
|
pg_xact_commit_timestamp(xmin) <= now(),
|
||||||
pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
|
pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
|
||||||
FROM committs_test
|
FROM committs_test
|
||||||
ORDER BY id;
|
ORDER BY id;
|
||||||
@ -31,7 +31,7 @@ SELECT pg_xact_commit_timestamp('1'::xid);
|
|||||||
ERROR: cannot retrieve commit timestamp for transaction 1
|
ERROR: cannot retrieve commit timestamp for transaction 1
|
||||||
SELECT pg_xact_commit_timestamp('2'::xid);
|
SELECT pg_xact_commit_timestamp('2'::xid);
|
||||||
ERROR: cannot retrieve commit timestamp for transaction 2
|
ERROR: cannot retrieve commit timestamp for transaction 2
|
||||||
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp < now() FROM pg_last_committed_xact() x;
|
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp <= now() FROM pg_last_committed_xact() x;
|
||||||
?column? | ?column? | ?column?
|
?column? | ?column? | ?column?
|
||||||
----------+----------+----------
|
----------+----------+----------
|
||||||
t | t | t
|
t | t | t
|
||||||
|
@ -13,7 +13,7 @@ INSERT INTO committs_test DEFAULT VALUES;
|
|||||||
INSERT INTO committs_test DEFAULT VALUES;
|
INSERT INTO committs_test DEFAULT VALUES;
|
||||||
SELECT id,
|
SELECT id,
|
||||||
pg_xact_commit_timestamp(xmin) >= ts,
|
pg_xact_commit_timestamp(xmin) >= ts,
|
||||||
pg_xact_commit_timestamp(xmin) < now(),
|
pg_xact_commit_timestamp(xmin) <= now(),
|
||||||
pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
|
pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
|
||||||
FROM committs_test
|
FROM committs_test
|
||||||
ORDER BY id;
|
ORDER BY id;
|
||||||
@ -29,6 +29,6 @@ HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
|
|||||||
SELECT pg_xact_commit_timestamp('2'::xid);
|
SELECT pg_xact_commit_timestamp('2'::xid);
|
||||||
ERROR: could not get commit timestamp data
|
ERROR: could not get commit timestamp data
|
||||||
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
|
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
|
||||||
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp < now() FROM pg_last_committed_xact() x;
|
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp <= now() FROM pg_last_committed_xact() x;
|
||||||
ERROR: could not get commit timestamp data
|
ERROR: could not get commit timestamp data
|
||||||
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
|
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
|
||||||
|
@ -10,7 +10,7 @@ INSERT INTO committs_test DEFAULT VALUES;
|
|||||||
|
|
||||||
SELECT id,
|
SELECT id,
|
||||||
pg_xact_commit_timestamp(xmin) >= ts,
|
pg_xact_commit_timestamp(xmin) >= ts,
|
||||||
pg_xact_commit_timestamp(xmin) < now(),
|
pg_xact_commit_timestamp(xmin) <= now(),
|
||||||
pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
|
pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
|
||||||
FROM committs_test
|
FROM committs_test
|
||||||
ORDER BY id;
|
ORDER BY id;
|
||||||
@ -21,4 +21,4 @@ SELECT pg_xact_commit_timestamp('0'::xid);
|
|||||||
SELECT pg_xact_commit_timestamp('1'::xid);
|
SELECT pg_xact_commit_timestamp('1'::xid);
|
||||||
SELECT pg_xact_commit_timestamp('2'::xid);
|
SELECT pg_xact_commit_timestamp('2'::xid);
|
||||||
|
|
||||||
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp < now() FROM pg_last_committed_xact() x;
|
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp <= now() FROM pg_last_committed_xact() x;
|
||||||
|
Reference in New Issue
Block a user