From f077e1b2e374fadc443b6aa9fa54ad9bb6f908c7 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thu, 9 Mar 2017 17:20:11 -0500
Subject: [PATCH] Fix timestamptz regression test to still work with latest
 IANA zone data.

The IANA timezone crew continues to chip away at their project of removing
timezone abbreviations that have no real-world currency from their
database.  The tzdata2017a update removes all such abbreviations for
South American zones, as well as much of the Pacific.  This breaks some
test cases in timestamptz.sql that were expecting America/Santiago and
America/Caracas to have non-numeric abbreviations.

The test cases involving America/Santiago seem to have selected that
zone more or less at random, so just replace it with America/New_York,
which is of similar longitude.  The cases involving America/Caracas are
harder since they were chosen to test a time-varying zone abbreviation
around a point where it changed meaning in the backwards direction.
Fortunately, Europe/Moscow has a similar case in 2014, and the MSK/MSD
abbreviations are well enough attested that IANA seems unlikely to
decide to remove them from the database in future.

With these changes, this regression test should pass when using any IANA
zone database from 2015 or later.  One could wish that there were a few
years more daylight on how out-of-date your zone database can be ... but
really the --with-system-tzdata option is only meant for use on platforms
where the zone database is kept up-to-date pretty faithfully, so I do not
think this is a big objection.

Discussion: https://postgr.es/m/6749.1489087470@sss.pgh.pa.us
---
 src/test/regress/expected/timestamptz.out | 324 ++++++++++--------------------
 src/test/regress/sql/timestamptz.sql      | 109 ++++------
 2 files changed, 151 insertions(+), 282 deletions(-)

Index: postgresql-9.5.6/src/test/regress/expected/timestamptz.out
===================================================================
--- postgresql-9.5.6.orig/src/test/regress/expected/timestamptz.out	2017-02-06 22:47:25.000000000 +0100
+++ postgresql-9.5.6/src/test/regress/expected/timestamptz.out	2017-03-16 18:15:44.431694498 +0100
@@ -1749,24 +1749,24 @@ SELECT * FROM TIMESTAMPTZ_TST ORDER BY a
 --Cleanup
 DROP TABLE TIMESTAMPTZ_TST;
 -- test timestamptz constructors
-set TimeZone to 'America/Santiago';
+set TimeZone to 'America/New_York';
 -- numeric timezone
 SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33);
         make_timestamptz         
 ---------------------------------
- Sun Jul 15 08:15:55.33 1973 CLT
+ Sun Jul 15 08:15:55.33 1973 EDT
 (1 row)
 
 SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '+2');
         make_timestamptz         
 ---------------------------------
- Sun Jul 15 02:15:55.33 1973 CLT
+ Sun Jul 15 02:15:55.33 1973 EDT
 (1 row)
 
 SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33, '-2');
         make_timestamptz         
 ---------------------------------
- Sun Jul 15 06:15:55.33 1973 CLT
+ Sun Jul 15 06:15:55.33 1973 EDT
 (1 row)
 
 WITH tzs (tz) AS (VALUES
@@ -1775,23 +1775,23 @@ WITH tzs (tz) AS (VALUES
     ('+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
+       make_timestamptz       |    tz     
+------------------------------+-----------
+ Fri Feb 26 21:45:00 2010 EST | +1
+ Fri Feb 26 21:45:00 2010 EST | +1:
+ Fri Feb 26 21:45:00 2010 EST | +1:0
+ Fri Feb 26 21:45:00 2010 EST | +100
+ Fri Feb 26 21:45:00 2010 EST | +1:00
+ Fri Feb 26 21:45:00 2010 EST | +01:00
+ Fri Feb 26 12:45:00 2010 EST | +10
+ Fri Feb 26 12:45:00 2010 EST | +1000
+ Fri Feb 26 12:45:00 2010 EST | +10:
+ Fri Feb 26 12:45:00 2010 EST | +10:0
+ Fri Feb 26 12:45:00 2010 EST | +10:00
+ Fri Feb 26 12:45:00 2010 EST | +10:00:
+ Fri Feb 26 12:44:59 2010 EST | +10:00:1
+ Fri Feb 26 12:44:59 2010 EST | +10:00:01
+ Fri Feb 26 12:44:50 2010 EST | +10:00:10
 (15 rows)
 
 -- these should fail
@@ -1837,30 +1837,29 @@ SELECT make_timestamptz(1881, 12, 10, 0,
 SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
 ERROR:  time zone "Nehwon/Lankhmar" not recognized
 -- abbreviations
-SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'CLST');
-       make_timestamptz        
--------------------------------
- Wed Dec 10 10:10:10 2008 CLST
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EST');
+       make_timestamptz       
+------------------------------
+ Wed Dec 10 10:10:10 2008 EST
 (1 row)
 
-SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'CLT');
-       make_timestamptz        
--------------------------------
- Wed Dec 10 11:10:10 2008 CLST
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EDT');
+       make_timestamptz       
+------------------------------
+ Wed Dec 10 09:10:10 2008 EST
 (1 row)
 
 SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, 'PST8PDT');
-       make_timestamptz        
--------------------------------
- Wed Dec 10 15:10:10 2014 CLST
+       make_timestamptz       
+------------------------------
+ Wed Dec 10 13:10:10 2014 EST
 (1 row)
 
 RESET TimeZone;
 --
 -- Test behavior with a dynamic (time-varying) timezone abbreviation.
 -- These tests rely on the knowledge that MSK (Europe/Moscow standard time)
--- moved forwards in Mar 2011 and that VET (America/Caracas standard time)
--- moved backwards in Dec 2007.
+-- moved forwards in Mar 2011 and backwards again in Oct 2014.
 --
 SET TimeZone to 'UTC';
 SELECT '2011-03-27 00:00:00 Europe/Moscow'::timestamptz;
@@ -1971,100 +1970,64 @@ SELECT '2011-03-27 04:00:00 MSK'::timest
  Sun Mar 27 00:00:00 2011 UTC
 (1 row)
 
-SELECT '2007-12-09 02:00:00 America/Caracas'::timestamptz;
-         timestamptz          
-------------------------------
- Sun Dec 09 06:00:00 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 02:29:59 America/Caracas'::timestamptz;
+SELECT '2014-10-26 00:00:00 Europe/Moscow'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 06:29:59 2007 UTC
+ Sat Oct 25 20:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:30:00 America/Caracas'::timestamptz;
+SELECT '2014-10-26 00:59:59 Europe/Moscow'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 07:00:00 2007 UTC
+ Sat Oct 25 20:59:59 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:30:01 America/Caracas'::timestamptz;
+SELECT '2014-10-26 01:00:00 Europe/Moscow'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 07:00:01 2007 UTC
+ Sat Oct 25 22:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:59:59 America/Caracas'::timestamptz;
+SELECT '2014-10-26 01:00:01 Europe/Moscow'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 07:29:59 2007 UTC
+ Sat Oct 25 22:00:01 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 03:00:00 America/Caracas'::timestamptz;
+SELECT '2014-10-26 02:00:00 Europe/Moscow'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 07:30:00 2007 UTC
+ Sat Oct 25 23:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 03:00:01 America/Caracas'::timestamptz;
+SELECT '2014-10-26 00:00:00 MSK'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 07:30:01 2007 UTC
+ Sat Oct 25 20:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 04:00:00 America/Caracas'::timestamptz;
+SELECT '2014-10-26 00:59:59 MSK'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 08:30:00 2007 UTC
+ Sat Oct 25 20:59:59 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:00:00 VET'::timestamptz;
+SELECT '2014-10-26 01:00:00 MSK'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 06:00:00 2007 UTC
+ Sat Oct 25 22:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:29:59 VET'::timestamptz;
+SELECT '2014-10-26 01:00:01 MSK'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 06:29:59 2007 UTC
+ Sat Oct 25 22:00:01 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:30:00 VET'::timestamptz;
+SELECT '2014-10-26 02:00:00 MSK'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 07:00:00 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 02:30:01 VET'::timestamptz;
-         timestamptz          
-------------------------------
- Sun Dec 09 07:00:01 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 02:59:59 VET'::timestamptz;
-         timestamptz          
-------------------------------
- Sun Dec 09 07:29:59 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 03:00:00 VET'::timestamptz;
-         timestamptz          
-------------------------------
- Sun Dec 09 07:30:00 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 03:00:01 VET'::timestamptz;
-         timestamptz          
-------------------------------
- Sun Dec 09 07:30:01 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 04:00:00 VET'::timestamptz;
-         timestamptz          
-------------------------------
- Sun Dec 09 08:30:00 2007 UTC
+ Sat Oct 25 23:00:00 2014 UTC
 (1 row)
 
 SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
@@ -2175,112 +2138,76 @@ SELECT '2011-03-27 04:00:00'::timestamp
  Sun Mar 27 00:00:00 2011 UTC
 (1 row)
 
-SELECT '2007-12-09 02:00:00'::timestamp AT TIME ZONE 'America/Caracas';
-           timezone           
-------------------------------
- Sun Dec 09 06:00:00 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 02:29:59'::timestamp AT TIME ZONE 'America/Caracas';
-           timezone           
-------------------------------
- Sun Dec 09 06:29:59 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 02:30:00'::timestamp AT TIME ZONE 'America/Caracas';
-           timezone           
-------------------------------
- Sun Dec 09 07:00:00 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 02:30:01'::timestamp AT TIME ZONE 'America/Caracas';
-           timezone           
-------------------------------
- Sun Dec 09 07:00:01 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 02:59:59'::timestamp AT TIME ZONE 'America/Caracas';
-           timezone           
-------------------------------
- Sun Dec 09 07:29:59 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 03:00:00'::timestamp AT TIME ZONE 'America/Caracas';
-           timezone           
-------------------------------
- Sun Dec 09 07:30:00 2007 UTC
-(1 row)
-
-SELECT '2007-12-09 03:00:01'::timestamp AT TIME ZONE 'America/Caracas';
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
            timezone           
 ------------------------------
- Sun Dec 09 07:30:01 2007 UTC
+ Sat Oct 25 20:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 04:00:00'::timestamp AT TIME ZONE 'America/Caracas';
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
            timezone           
 ------------------------------
- Sun Dec 09 08:30:00 2007 UTC
+ Sat Oct 25 20:59:59 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:00:00'::timestamp AT TIME ZONE 'VET';
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
            timezone           
 ------------------------------
- Sun Dec 09 06:00:00 2007 UTC
+ Sat Oct 25 22:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:29:59'::timestamp AT TIME ZONE 'VET';
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
            timezone           
 ------------------------------
- Sun Dec 09 06:29:59 2007 UTC
+ Sat Oct 25 22:00:01 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:30:00'::timestamp AT TIME ZONE 'VET';
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
            timezone           
 ------------------------------
- Sun Dec 09 07:00:00 2007 UTC
+ Sat Oct 25 23:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:30:01'::timestamp AT TIME ZONE 'VET';
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'MSK';
            timezone           
 ------------------------------
- Sun Dec 09 07:00:01 2007 UTC
+ Sat Oct 25 20:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 02:59:59'::timestamp AT TIME ZONE 'VET';
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'MSK';
            timezone           
 ------------------------------
- Sun Dec 09 07:29:59 2007 UTC
+ Sat Oct 25 20:59:59 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 03:00:00'::timestamp AT TIME ZONE 'VET';
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'MSK';
            timezone           
 ------------------------------
- Sun Dec 09 07:30:00 2007 UTC
+ Sat Oct 25 22:00:00 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 03:00:01'::timestamp AT TIME ZONE 'VET';
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'MSK';
            timezone           
 ------------------------------
- Sun Dec 09 07:30:01 2007 UTC
+ Sat Oct 25 22:00:01 2014 UTC
 (1 row)
 
-SELECT '2007-12-09 04:00:00'::timestamp AT TIME ZONE 'VET';
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'MSK';
            timezone           
 ------------------------------
- Sun Dec 09 08:30:00 2007 UTC
+ Sat Oct 25 23:00:00 2014 UTC
 (1 row)
 
-SELECT make_timestamptz(2007, 12, 9, 2, 0, 0, 'VET');
+SELECT make_timestamptz(2014, 10, 26, 0, 0, 0, 'MSK');
        make_timestamptz       
 ------------------------------
- Sun Dec 09 06:00:00 2007 UTC
+ Sat Oct 25 20:00:00 2014 UTC
 (1 row)
 
-SELECT make_timestamptz(2007, 12, 9, 3, 0, 0, 'VET');
+SELECT make_timestamptz(2014, 10, 26, 1, 0, 0, 'MSK');
        make_timestamptz       
 ------------------------------
- Sun Dec 09 07:30:00 2007 UTC
+ Sat Oct 25 22:00:00 2014 UTC
 (1 row)
 
 SET TimeZone to 'Europe/Moscow';
@@ -2326,47 +2253,34 @@ SELECT '2011-03-27 00:00:00 UTC'::timest
  Sun Mar 27 04:00:00 2011 MSK
 (1 row)
 
-SET TimeZone to 'America/Caracas';
-SELECT '2007-12-09 06:00:00 UTC'::timestamptz;
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 02:00:00 2007 VET
+ Sun Oct 26 01:00:00 2014 MSK
 (1 row)
 
-SELECT '2007-12-09 06:30:00 UTC'::timestamptz;
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 02:30:00 2007 VET
+ Sun Oct 26 01:59:59 2014 MSK
 (1 row)
 
-SELECT '2007-12-09 06:59:59 UTC'::timestamptz;
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 02:59:59 2007 VET
+ Sun Oct 26 01:00:00 2014 MSK
 (1 row)
 
-SELECT '2007-12-09 07:00:00 UTC'::timestamptz;
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 02:30:00 2007 VET
+ Sun Oct 26 01:00:01 2014 MSK
 (1 row)
 
-SELECT '2007-12-09 07:00:01 UTC'::timestamptz;
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz;
          timestamptz          
 ------------------------------
- Sun Dec 09 02:30:01 2007 VET
-(1 row)
-
-SELECT '2007-12-09 07:29:59 UTC'::timestamptz;
-         timestamptz          
-------------------------------
- Sun Dec 09 02:59:59 2007 VET
-(1 row)
-
-SELECT '2007-12-09 07:30:00 UTC'::timestamptz;
-         timestamptz          
-------------------------------
- Sun Dec 09 03:00:00 2007 VET
+ Sun Oct 26 02:00:00 2014 MSK
 (1 row)
 
 RESET TimeZone;
@@ -2412,46 +2326,34 @@ SELECT '2011-03-27 00:00:00 UTC'::timest
  Sun Mar 27 04:00:00 2011
 (1 row)
 
-SELECT '2007-12-09 06:00:00 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
-         timezone         
---------------------------
- Sun Dec 09 02:00:00 2007
-(1 row)
-
-SELECT '2007-12-09 06:30:00 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
          timezone         
 --------------------------
- Sun Dec 09 02:30:00 2007
+ Sun Oct 26 01:00:00 2014
 (1 row)
 
-SELECT '2007-12-09 06:59:59 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
          timezone         
 --------------------------
- Sun Dec 09 02:59:59 2007
+ Sun Oct 26 01:59:59 2014
 (1 row)
 
-SELECT '2007-12-09 07:00:00 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
          timezone         
 --------------------------
- Sun Dec 09 02:30:00 2007
+ Sun Oct 26 01:00:00 2014
 (1 row)
 
-SELECT '2007-12-09 07:00:01 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
          timezone         
 --------------------------
- Sun Dec 09 02:30:01 2007
+ Sun Oct 26 01:00:01 2014
 (1 row)
 
-SELECT '2007-12-09 07:29:59 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
          timezone         
 --------------------------
- Sun Dec 09 02:59:59 2007
-(1 row)
-
-SELECT '2007-12-09 07:30:00 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
-         timezone         
---------------------------
- Sun Dec 09 03:00:00 2007
+ Sun Oct 26 02:00:00 2014
 (1 row)
 
 SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
@@ -2496,46 +2398,34 @@ SELECT '2011-03-27 00:00:00 UTC'::timest
  Sun Mar 27 04:00:00 2011
 (1 row)
 
-SELECT '2007-12-09 06:00:00 UTC'::timestamptz AT TIME ZONE 'VET';
-         timezone         
---------------------------
- Sun Dec 09 02:00:00 2007
-(1 row)
-
-SELECT '2007-12-09 06:30:00 UTC'::timestamptz AT TIME ZONE 'VET';
-         timezone         
---------------------------
- Sun Dec 09 02:30:00 2007
-(1 row)
-
-SELECT '2007-12-09 06:59:59 UTC'::timestamptz AT TIME ZONE 'VET';
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
          timezone         
 --------------------------
- Sun Dec 09 02:59:59 2007
+ Sun Oct 26 01:00:00 2014
 (1 row)
 
-SELECT '2007-12-09 07:00:00 UTC'::timestamptz AT TIME ZONE 'VET';
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
          timezone         
 --------------------------
- Sun Dec 09 02:30:00 2007
+ Sun Oct 26 01:59:59 2014
 (1 row)
 
-SELECT '2007-12-09 07:00:01 UTC'::timestamptz AT TIME ZONE 'VET';
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
          timezone         
 --------------------------
- Sun Dec 09 02:30:01 2007
+ Sun Oct 26 01:00:00 2014
 (1 row)
 
-SELECT '2007-12-09 07:29:59 UTC'::timestamptz AT TIME ZONE 'VET';
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
          timezone         
 --------------------------
- Sun Dec 09 02:59:59 2007
+ Sun Oct 26 01:00:01 2014
 (1 row)
 
-SELECT '2007-12-09 07:30:00 UTC'::timestamptz AT TIME ZONE 'VET';
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
          timezone         
 --------------------------
- Sun Dec 09 03:00:00 2007
+ Sun Oct 26 02:00:00 2014
 (1 row)
 
 --
Index: postgresql-9.5.6/src/test/regress/sql/timestamptz.sql
===================================================================
--- postgresql-9.5.6.orig/src/test/regress/sql/timestamptz.sql	2017-02-06 22:47:25.000000000 +0100
+++ postgresql-9.5.6/src/test/regress/sql/timestamptz.sql	2017-03-16 18:15:44.431694498 +0100
@@ -273,7 +273,7 @@ SELECT * FROM TIMESTAMPTZ_TST ORDER BY a
 DROP TABLE TIMESTAMPTZ_TST;
 
 -- test timestamptz constructors
-set TimeZone to 'America/Santiago';
+set TimeZone to 'America/New_York';
 
 -- numeric timezone
 SELECT make_timestamptz(1973, 07, 15, 08, 15, 55.33);
@@ -302,8 +302,8 @@ SELECT make_timestamptz(1881, 12, 10, 0,
 SELECT make_timestamptz(1910, 12, 24, 0, 0, 0, 'Nehwon/Lankhmar');
 
 -- abbreviations
-SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'CLST');
-SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'CLT');
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EST');
+SELECT make_timestamptz(2008, 12, 10, 10, 10, 10, 'EDT');
 SELECT make_timestamptz(2014, 12, 10, 10, 10, 10, 'PST8PDT');
 
 RESET TimeZone;
@@ -311,8 +311,7 @@ RESET TimeZone;
 --
 -- Test behavior with a dynamic (time-varying) timezone abbreviation.
 -- These tests rely on the knowledge that MSK (Europe/Moscow standard time)
--- moved forwards in Mar 2011 and that VET (America/Caracas standard time)
--- moved backwards in Dec 2007.
+-- moved forwards in Mar 2011 and backwards again in Oct 2014.
 --
 
 SET TimeZone to 'UTC';
@@ -337,23 +336,17 @@ SELECT '2011-03-27 03:00:00 MSK'::timest
 SELECT '2011-03-27 03:00:01 MSK'::timestamptz;
 SELECT '2011-03-27 04:00:00 MSK'::timestamptz;
 
-SELECT '2007-12-09 02:00:00 America/Caracas'::timestamptz;
-SELECT '2007-12-09 02:29:59 America/Caracas'::timestamptz;
-SELECT '2007-12-09 02:30:00 America/Caracas'::timestamptz;
-SELECT '2007-12-09 02:30:01 America/Caracas'::timestamptz;
-SELECT '2007-12-09 02:59:59 America/Caracas'::timestamptz;
-SELECT '2007-12-09 03:00:00 America/Caracas'::timestamptz;
-SELECT '2007-12-09 03:00:01 America/Caracas'::timestamptz;
-SELECT '2007-12-09 04:00:00 America/Caracas'::timestamptz;
-
-SELECT '2007-12-09 02:00:00 VET'::timestamptz;
-SELECT '2007-12-09 02:29:59 VET'::timestamptz;
-SELECT '2007-12-09 02:30:00 VET'::timestamptz;
-SELECT '2007-12-09 02:30:01 VET'::timestamptz;
-SELECT '2007-12-09 02:59:59 VET'::timestamptz;
-SELECT '2007-12-09 03:00:00 VET'::timestamptz;
-SELECT '2007-12-09 03:00:01 VET'::timestamptz;
-SELECT '2007-12-09 04:00:00 VET'::timestamptz;
+SELECT '2014-10-26 00:00:00 Europe/Moscow'::timestamptz;
+SELECT '2014-10-26 00:59:59 Europe/Moscow'::timestamptz;
+SELECT '2014-10-26 01:00:00 Europe/Moscow'::timestamptz;
+SELECT '2014-10-26 01:00:01 Europe/Moscow'::timestamptz;
+SELECT '2014-10-26 02:00:00 Europe/Moscow'::timestamptz;
+
+SELECT '2014-10-26 00:00:00 MSK'::timestamptz;
+SELECT '2014-10-26 00:59:59 MSK'::timestamptz;
+SELECT '2014-10-26 01:00:00 MSK'::timestamptz;
+SELECT '2014-10-26 01:00:01 MSK'::timestamptz;
+SELECT '2014-10-26 02:00:00 MSK'::timestamptz;
 
 SELECT '2011-03-27 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
 SELECT '2011-03-27 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
@@ -375,26 +368,20 @@ SELECT '2011-03-27 03:00:00'::timestamp
 SELECT '2011-03-27 03:00:01'::timestamp AT TIME ZONE 'MSK';
 SELECT '2011-03-27 04:00:00'::timestamp AT TIME ZONE 'MSK';
 
-SELECT '2007-12-09 02:00:00'::timestamp AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 02:29:59'::timestamp AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 02:30:00'::timestamp AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 02:30:01'::timestamp AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 02:59:59'::timestamp AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 03:00:00'::timestamp AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 03:00:01'::timestamp AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 04:00:00'::timestamp AT TIME ZONE 'America/Caracas';
-
-SELECT '2007-12-09 02:00:00'::timestamp AT TIME ZONE 'VET';
-SELECT '2007-12-09 02:29:59'::timestamp AT TIME ZONE 'VET';
-SELECT '2007-12-09 02:30:00'::timestamp AT TIME ZONE 'VET';
-SELECT '2007-12-09 02:30:01'::timestamp AT TIME ZONE 'VET';
-SELECT '2007-12-09 02:59:59'::timestamp AT TIME ZONE 'VET';
-SELECT '2007-12-09 03:00:00'::timestamp AT TIME ZONE 'VET';
-SELECT '2007-12-09 03:00:01'::timestamp AT TIME ZONE 'VET';
-SELECT '2007-12-09 04:00:00'::timestamp AT TIME ZONE 'VET';
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow';
+
+SELECT '2014-10-26 00:00:00'::timestamp AT TIME ZONE 'MSK';
+SELECT '2014-10-26 00:59:59'::timestamp AT TIME ZONE 'MSK';
+SELECT '2014-10-26 01:00:00'::timestamp AT TIME ZONE 'MSK';
+SELECT '2014-10-26 01:00:01'::timestamp AT TIME ZONE 'MSK';
+SELECT '2014-10-26 02:00:00'::timestamp AT TIME ZONE 'MSK';
 
-SELECT make_timestamptz(2007, 12, 9, 2, 0, 0, 'VET');
-SELECT make_timestamptz(2007, 12, 9, 3, 0, 0, 'VET');
+SELECT make_timestamptz(2014, 10, 26, 0, 0, 0, 'MSK');
+SELECT make_timestamptz(2014, 10, 26, 1, 0, 0, 'MSK');
 
 SET TimeZone to 'Europe/Moscow';
 
@@ -406,15 +393,11 @@ SELECT '2011-03-26 23:00:01 UTC'::timest
 SELECT '2011-03-26 23:59:59 UTC'::timestamptz;
 SELECT '2011-03-27 00:00:00 UTC'::timestamptz;
 
-SET TimeZone to 'America/Caracas';
-
-SELECT '2007-12-09 06:00:00 UTC'::timestamptz;
-SELECT '2007-12-09 06:30:00 UTC'::timestamptz;
-SELECT '2007-12-09 06:59:59 UTC'::timestamptz;
-SELECT '2007-12-09 07:00:00 UTC'::timestamptz;
-SELECT '2007-12-09 07:00:01 UTC'::timestamptz;
-SELECT '2007-12-09 07:29:59 UTC'::timestamptz;
-SELECT '2007-12-09 07:30:00 UTC'::timestamptz;
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz;
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz;
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz;
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz;
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz;
 
 RESET TimeZone;
 
@@ -426,13 +409,11 @@ SELECT '2011-03-26 23:00:01 UTC'::timest
 SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
 SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
 
-SELECT '2007-12-09 06:00:00 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 06:30:00 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 06:59:59 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 07:00:00 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 07:00:01 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 07:29:59 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
-SELECT '2007-12-09 07:30:00 UTC'::timestamptz AT TIME ZONE 'America/Caracas';
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'Europe/Moscow';
 
 SELECT '2011-03-26 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
 SELECT '2011-03-26 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
@@ -442,13 +423,11 @@ SELECT '2011-03-26 23:00:01 UTC'::timest
 SELECT '2011-03-26 23:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
 SELECT '2011-03-27 00:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
 
-SELECT '2007-12-09 06:00:00 UTC'::timestamptz AT TIME ZONE 'VET';
-SELECT '2007-12-09 06:30:00 UTC'::timestamptz AT TIME ZONE 'VET';
-SELECT '2007-12-09 06:59:59 UTC'::timestamptz AT TIME ZONE 'VET';
-SELECT '2007-12-09 07:00:00 UTC'::timestamptz AT TIME ZONE 'VET';
-SELECT '2007-12-09 07:00:01 UTC'::timestamptz AT TIME ZONE 'VET';
-SELECT '2007-12-09 07:29:59 UTC'::timestamptz AT TIME ZONE 'VET';
-SELECT '2007-12-09 07:30:00 UTC'::timestamptz AT TIME ZONE 'VET';
+SELECT '2014-10-25 21:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2014-10-25 21:59:59 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2014-10-25 22:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2014-10-25 22:00:01 UTC'::timestamptz AT TIME ZONE 'MSK';
+SELECT '2014-10-25 23:00:00 UTC'::timestamptz AT TIME ZONE 'MSK';
 
 --
 -- Test that the pg_timezone_names and pg_timezone_abbrevs views are
