Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0916eba

Browse files
committed
Fix commit_ts test suite for systems with coarse timestamp granularity.
Noticed on a couple of Windows configurations.Petr Jelinek, reviewed by Michael Paquier.
1 parent733a264 commit0916eba

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎src/test/modules/commit_ts/expected/commit_timestamp.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ INSERT INTO committs_test DEFAULT VALUES;
1313
INSERT INTO committs_test DEFAULT VALUES;
1414
SELECT id,
1515
pg_xact_commit_timestamp(xmin) >= ts,
16-
pg_xact_commit_timestamp(xmin) < now(),
16+
pg_xact_commit_timestamp(xmin) <= now(),
1717
pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
1818
FROM committs_test
1919
ORDER BY id;
@@ -31,7 +31,7 @@ SELECT pg_xact_commit_timestamp('1'::xid);
3131
ERROR: cannot retrieve commit timestamp for transaction 1
3232
SELECT pg_xact_commit_timestamp('2'::xid);
3333
ERROR: cannot retrieve commit timestamp for transaction 2
34-
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp < now() FROM pg_last_committed_xact() x;
34+
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp <= now() FROM pg_last_committed_xact() x;
3535
?column? | ?column? | ?column?
3636
----------+----------+----------
3737
t | t | t

‎src/test/modules/commit_ts/expected/commit_timestamp_1.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ INSERT INTO committs_test DEFAULT VALUES;
1313
INSERT INTO committs_test DEFAULT VALUES;
1414
SELECT id,
1515
pg_xact_commit_timestamp(xmin) >= ts,
16-
pg_xact_commit_timestamp(xmin) < now(),
16+
pg_xact_commit_timestamp(xmin) <= now(),
1717
pg_xact_commit_timestamp(xmin) - ts < '60s' -- 60s should give a lot of reserve
1818
FROM committs_test
1919
ORDER BY id;
@@ -29,6 +29,6 @@ HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
2929
SELECT pg_xact_commit_timestamp('2'::xid);
3030
ERROR: could not get commit timestamp data
3131
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.
32-
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp < now() FROM pg_last_committed_xact() x;
32+
SELECT x.xid::text::bigint > 0, x.timestamp > '-infinity'::timestamptz, x.timestamp <= now() FROM pg_last_committed_xact() x;
3333
ERROR: could not get commit timestamp data
3434
HINT: Make sure the configuration parameter "track_commit_timestamp" is set.

‎src/test/modules/commit_ts/sql/commit_timestamp.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ INSERT INTO committs_test DEFAULT VALUES;
1010

1111
SELECT id,
1212
pg_xact_commit_timestamp(xmin)>= ts,
13-
pg_xact_commit_timestamp(xmin)< now(),
13+
pg_xact_commit_timestamp(xmin)<= now(),
1414
pg_xact_commit_timestamp(xmin)- ts<'60s'-- 60s should give a lot of reserve
1515
FROM committs_test
1616
ORDER BY id;
@@ -21,4 +21,4 @@ SELECT pg_xact_commit_timestamp('0'::xid);
2121
SELECT pg_xact_commit_timestamp('1'::xid);
2222
SELECT pg_xact_commit_timestamp('2'::xid);
2323

24-
SELECTx.xid::text::bigint>0,x.timestamp>'-infinity'::timestamptz,x.timestamp< now()FROM pg_last_committed_xact() x;
24+
SELECTx.xid::text::bigint>0,x.timestamp>'-infinity'::timestamptz,x.timestamp<= now()FROM pg_last_committed_xact() x;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp