Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: invalid value for parameter "TimeZone": "Canada/East-Saskatchewan"

I'm importing a database which is working with psql (PostgreSQL) 9.5.10. for my local database v.9.6.5.

This is the problematic part:

COPY timezone (id, name, windowsname, tzindex) FROM stdin;
...
315     Canada/East-Saskatchewan        \N      \N
...

This is the error I'm getting:

pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 9024; 0 48454 TABLE DATA timezone skysms pg_restore: [archiver (db)] COPY failed for table "timezone": ERROR: invalid value for parameter "TimeZone": "Canada/East-Saskatchewan" CONTEXT: SQL statement "SET local timezone to 'Canada/East-Saskatchewan'" PL/pgSQL function display_in_other_tz(timestamp with time zone,text,text) line 7 at EXECUTE statement COPY timezone, line 315: "315 Canada/East-Saskatchewan \N \N"

like image 259
Fernando César Avatar asked Dec 03 '17 13:12

Fernando César


1 Answers

The zone Canada/East-Saskatchewan used to be a valid time zone identifier. It was a link/alias for the America/Regina time zone. However, it was removed from the tz database in the last version (2017c). You can see the commit here.

The 2017c release announcement states:

Remove Canada/East-Saskatchewan from the 'backward' file, as it exceeded the 14-character limit and was an unused misnomer anyway.

So, while normally time zone identifiers are not removed in this manner, for this particular one it was deemed necessary due to its length.

You can safely update any entry of Canada/East-Saskatchewan to the prefered locality-based form of the zone: America/Regina.

like image 80
Matt Johnson-Pint Avatar answered Sep 27 '22 21:09

Matt Johnson-Pint