pgsql: Remove gratuitous environment dependency in 002_types.pl test.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove gratuitous environment dependency in 002_types.pl test.
Date: 2021-09-30 20:24:13
Message-ID: E1mW2bF-00008Z-Ge@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove gratuitous environment dependency in 002_types.pl test.

Computing related timestamps by subtracting "N days" is sensitive
to the prevailing timezone, since we interpret that as "same local
time on the N'th prior day". Even though the intervals in question
are only two to four days, through remarkable bad luck they managed
to cross the end of Ramadan in 2014, causing the test's output to
change if timezone is set to Africa/Casablanca. (Maybe in other
Muslim areas as well; I didn't check.) There's absolutely no reason
for this test to exercise interval subtraction, so just get rid of
that and use plain timestamptz constants representing the intended
values.

Per report from Andres Freund. Back-patch to v10 where this test
script came in.

Discussion: https://postgr.es/m/20210930183641.7lh4jhvpipvromca@alap3.anarazel.de

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f2cf745a038c984092b74fe5b82b892721f9310e

Modified Files
--------------
src/test/subscription/t/002_types.pl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2021-10-01 02:10:38 pgsql: Ensure interleaved_parts field is always initialized
Previous Message Robert Haas 2021-09-30 19:02:04 Re: pgsql: Document XLOG_INCLUDE_XID a little better