PostgreSQL failed IANA tz database BUG修复

本文涉及的产品
云原生数据库 PolarDB MySQL 版,Serverless 5000PCU 100GB
云原生数据库 PolarDB 分布式版,标准版 2核8GB
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

背景

PostgreSQL 可以使用IANA发布的时区数据库,但是由于IANA发布的数据库中,有些定义的时区别名并没有对应的时区。

从而导致PG在解析对应别名时会报错。

# select '2016-09-02 08:00:00 NOVST'::timestamptz;
ERROR:  time zone abbreviation "novst" is not used in time zone "Asia/Novosibirsk"

查询pg_timezone_abbrevs函数返回所有的别名与时区对应关系,也会报错。

postgres=# select pg_timezone_abbrevs ();
ERROR:  time zone abbreviation "novst" is not used in time zone "Asia/Novosibirsk"

修复BUG

在PostgreSQL的BUG报告中已经有在讨论这个问题

https://www.postgresql.org/message-id/flat/20160902031551.15674.67337%40wrigleys.postgresql.org#20160902031551.15674.67337@wrigleys.postgresql.org

https://www.postgresql.org/message-id/flat/6189.1472820913%40sss.pgh.pa.us#6189.1472820913@sss.pgh.pa.us

TOM LANE提供了一个patch,可以避免出现以上问题。

wget https://www.postgresql.org/message-id/attachment/45970/allow-timezone-abbrevs-not-matching-iana-data.patch
cd postgresql-9.5.4
patch -p1 < ../allow-timezone-abbrevs-not-matching-iana-data.patch
make -j 32
make install

重启数据库,测试,如果时区别名不存在时区映射关系时,使用了本地时区。

postgres=# select '2016-09-02 08:00:00 NOVST'::timestamptz;
      timestamptz       
------------------------
 2016-09-02 09:00:00+08
(1 row)

长期来看,等PG的内核修复。

参考

https://www.postgresql.org/message-id/flat/20160902031551.15674.67337%40wrigleys.postgresql.org#20160902031551.15674.67337@wrigleys.postgresql.org

https://www.postgresql.org/message-id/flat/6189.1472820913%40sss.pgh.pa.us#6189.1472820913@sss.pgh.pa.us

Count

相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
相关文章
|
2月前
|
数据挖掘 数据库
GEE——降水数据分析(半天)图表分析含(IANA(IANA Time Zone Database) 时区名称的定义)
GEE——降水数据分析(半天)图表分析含(IANA(IANA Time Zone Database) 时区名称的定义)
29 1
|
9月前
|
XML 关系型数据库 MySQL
已解决Failed to connect mysql database,please check username and password,or mysql is version8? true
已解决Failed to connect mysql database,please check username and password,or mysql is version8? true
123 0
|
关系型数据库 MySQL 数据库
Idea 连接数据库出错Connection to xxx@localhost failed. [08001] Could not create connection to database
Idea 连接数据库出错Connection to xxx@localhost failed. [08001] Could not create connection to database
284 0
Idea 连接数据库出错Connection to xxx@localhost failed. [08001] Could not create connection to database
|
弹性计算 安全 关系型数据库
PostgreSQL 12 preview - 可靠性提升 - data_sync_retry 消除os层write back failed status不可靠的问题
标签 PostgreSQL , data_sync_retry , write back , retry , failed status 背景 有些OS系统,对fsync的二次调用不敏感,因为OS层可能有自己的CACHE,如果使用了buffer write,并且出现write back failed的情况,有些OS可能在下次fsync时并不能正确的反馈fsync的可靠性与否。(因为这个B
515 0
|
关系型数据库 数据库
ORA-01501: CREATE DATABASE failed
使用dbca建库时遇到ORA-01501: CREATE DATABASE failed这个错误,检查告警日志,发现有下面错误信息: SMON: enabling tx recovery Fri Apr 29 14:06:25 HKT 2016 replication_dependenc...
2026 0
|
数据库 内存技术
ORA-38760: This database instance failed to turn on flashback database 第三篇
ORA-38760: This database instance failed to turn on flashback database  第三篇   第一篇 第二篇 问题现象:      在数据库alert告警日志中看见如下信息:...
1119 0
|
关系型数据库 数据库 Oracle
ORA-38760: This database instance failed to turn on flashback database
ORA-38760: This database instance failed to turn on flashback database 问题背景:        测试数据库执行shutdown immediate,日志里面报错,错误信息...
1002 0
|
Oracle 关系型数据库 数据库
ORA-38760: This database instance failed to turn on flashback database 错误解决过程
ORA-38760: This database instance failed to turn on flashback database  错误解决过程   问题现象:           一大早起床把数据库打开,本来想做个测试,结果不料弹出ORA-38760: This database instance failed to turn on flashback database的错误,这个错误很显然是由于flashback导致的错误。
1293 0

相关产品

  • 云原生数据库 PolarDB