Re: [HACKERS] tzdata2017a breaks timestamptz regression test

2017-03-10 Thread Alvaro Herrera
Tom Lane wrote:

> For the cases involving the America/Santiago zone, I'm a bit inclined
> to just switch that to America/New_York, which seems much less likely
> to get fooled with by IANA.  But I'm wondering if Alvaro had a specific
> reason for using the Santiago zone in those test cases.

No, I just used the Santiago zone because it was local.  But I agree
it's a bad one to use, because in the last decade politicians have been
playing with it excessively, so +1 for changing to something else.

> What I propose we do about that is replace the America/Caracas test cases
> with Europe/Moscow tests, moving the dates as needed to match DST
> transitions from when Moscow was observing DST (pre 2011).  The comments
> in the IANA files indicate that they believe the MSK/MSD abbreviations
> have or had real-world usage, so they probably won't replace them with
> numeric offsets.  We can hope, anyway.

Sounds reasonable to me.

-- 
Álvaro Herrerahttps://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] tzdata2017a breaks timestamptz regression test

2017-03-09 Thread Tom Lane
I typically build with --with-system-tzdata, which means that any time
Red Hat sees fit to push out a new copy of the tzdata package, that's
what I'm testing against.  This morning they updated to tzdata2017a,
and I'm seeing the attached test failures.

The reason for this is that the IANA crew have really moved forward
aggressively on their project to remove invented zone abbreviations.
As stated at
http://mm.icann.org/pipermail/tz-announce/2017-February/45.html
they've removed text abbreviations for pretty much all of South
America, which is what's breaking these cases.

For the cases involving the America/Santiago zone, I'm a bit inclined
to just switch that to America/New_York, which seems much less likely
to get fooled with by IANA.  But I'm wondering if Alvaro had a specific
reason for using the Santiago zone in those test cases.

The diffs involving VET (America/Caracas) are more problematic: we're
intentionally trying to test a time-varying zone abbreviation, so we can't
just switch to a stable zone.  As far as the lines 2395..2437 hunk goes,
we could perhaps make that segment of the test print in ISO datestyle
instead of Postgres datestyle, which would force the zone to be printed in
numeric form not as an abbreviation.  That's slightly annoying, but it
doesn't really compromise what that part of the test is trying to test.
However, the very last hunk indicates that VET no longer functions as a
time-varying zone abbreviation at all, because it doesn't match any
abbreviation recorded for America/Caracas in the IANA database, so we fall
back to treating it as a simple synonym for America/Caracas (cf commit
39b691f25).  So that's now failing altogether to test what it means to.

What I propose we do about that is replace the America/Caracas test cases
with Europe/Moscow tests, moving the dates as needed to match DST
transitions from when Moscow was observing DST (pre 2011).  The comments
in the IANA files indicate that they believe the MSK/MSD abbreviations
have or had real-world usage, so they probably won't replace them with
numeric offsets.  We can hope, anyway.

regards, tom lane

*** /home/postgres/pgsql/src/test/regress/expected/timestamptz.out	Mon Jan 30 17:03:46 2017
--- /home/postgres/pgsql/src/test/regress/results/timestamptz.out	Thu Mar  9 13:35:41 2017
***
*** 1778,1796 
  SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33);
  make_timestamptz 
  -
!  Sun Jul 15 08:15:55.33 1973 CLT
  (1 row)
  
  SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2');
  make_timestamptz 
  -
!  Sun Jul 15 02:15:55.33 1973 CLT
  (1 row)
  
  SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '-2');
  make_timestamptz 
  -
!  Sun Jul 15 06:15:55.33 1973 CLT
  (1 row)
  
  WITH tzs (tz) AS (VALUES
--- 1778,1796 
  SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33);
  make_timestamptz 
  -
!  Sun Jul 15 08:15:55.33 1973 -04
  (1 row)
  
  SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2');
  make_timestamptz 
  -
!  Sun Jul 15 02:15:55.33 1973 -04
  (1 row)
  
  SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '-2');
  make_timestamptz 
  -
!  Sun Jul 15 06:15:55.33 1973 -04
  (1 row)
  
  WITH tzs (tz) AS (VALUES
***
*** 1799,1821 
  ('+10:00:1'), ('+10:00:01'),
  ('+10:00:10'))
   SELECT make_timestamptz(2010, 2, 27, 3, 45, 00, tz), tz FROM tzs;
!make_timestamptz|tz 
! ---+---
!  Fri Feb 26 23:45:00 2010 CLST | +1
!  Fri Feb 26 23:45:00 2010 CLST | +1:
!  Fri Feb 26 23:45:00 2010 CLST | +1:0
!  Fri Feb 26 23:45:00 2010 CLST | +100
!  Fri Feb 26 23:45:00 2010 CLST | +1:00
!  Fri Feb 26 23:45:00 2010 CLST | +01:00
!  Fri Feb 26 14:45:00 2010 CLST | +10
!  Fri Feb 26 14:45:00 2010 CLST | +1000
!  Fri Feb 26 14:45:00 2010 CLST | +10:
!  Fri Feb 26 14:45:00 2010 CLST | +10:0
!  Fri Feb 26 14:45:00 2010 CLST | +10:00
!  Fri Feb 26 14:45:00 2010 CLST | +10:00:
!  Fri Feb 26 14:44:59 2010 CLST | +10:00:1
!  Fri Feb 26 14:44:59 2010 CLST | +10:00:01
!  Fri Feb 26 14:44:50 2010 CLST | +10:00:10
  (15 rows)
  
  -- these should fail
--- 1799,1821 
  ('+10:00:1'), ('+10:00:01'),
  ('+10:00:10'))
   SELECT make_timestamptz(2010, 2, 27, 3, 45, 00, tz), tz FROM tzs;
!make_timestamptz   |tz 
! --+---
!  Fri Feb 26 23:45:00 2010 -03 | +1
!  Fri Feb 26 23:45:00 2010 -03 | +1:
!  Fri Feb 26 23:45:00 2010 -03 | +1:0
!  Fri Feb 26 23:45:00 2010 -03 | +100
!  Fri Feb 26 23:45:00 2010 -03 | +1:00
!  Fri Feb 26 23:45:00 2010 -03 | +01:00
!  Fri Feb 26 14:45:00 2010 -03 | +10
!  Fri Feb 26 14:45:00 2010 -03 | +1000
!  Fri