错误:参数"TimeZone"的值无效:"Canada/East-Saskatchewan"

Fer*_*sar 4 database postgresql timezone database-restore

我正在导入一个使用psql(PostgreSQL)9.5.10的数据库.对于我的本地数据库v.9.6.5.

这是有问题的部分:

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

这是我得到的错误:

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"

Mat*_*int 9

该区域Canada/East-Saskatchewan曾经是有效的时区标识符.它是America/Regina时区的链接/别名.但是,它已在上一版本(2017c)中从tz数据库中删除.你可以在这里看到提交.

2017c发布公告声明:

从"后退"文件中删除Canada/East-Saskatchewan,因为它超过了14个字符的限制,无论如何都是一个未使用的误称.

因此,虽然通常不以这种方式移除时区标识符,但对于该特定的标识符,由于其长度而被认为是必要的.

您可以安全地更新Canada/East-Saskatchewan区域的首选基于位置的形式的任何条目:America/Regina.