如何在将 PostgreSQL 从 11.20 升级到 12.15 时修复 ‘type abstime does not exist’ 错误?

huangapple go评论68阅读模式
英文:

How to fix 'type abstime does not exist' error when upgrading PostgreSQL from 11.20 to 12.15?

问题

Trying to upgrade PostgreSQL from 11.20 to 12.15 and hitting the below error

pg_restore: error: could not execute query: ERROR: type "abstime" does not exist

I do understand that Data types abstime, reltime, and tinterval were removed by postgres under enhancements or version upgrades. but I believe there must be someone in the community who must have faced this issue and managed to find a solution to this problem.

is there anyone in community could help as would like to make progress and keep things secure.

tried to look into KB articles but couldn't find any solution. Looking for solution

尝试将PostgreSQL从11.20升级到12.15,并出现以下错误

pg_restore: error: 无法执行查询:ERROR:类型 "abstime" 不存在

我了解数据类型abstime、reltime和tinterval在PostgreSQL的增强或版本升级中被移除了,但我相信社区中一定有人遇到过这个问题并成功找到了解决方法。

有社区中的任何人能够提供帮助吗?因为我希望能够继续进行并确保事情安全。

尝试查阅知识库文章,但未找到解决方案。正在寻找解决方案。

英文:

Trying to upgrade PostgreSQL from 11.20 to 12.15 and hitting the below error

pg_restore: error: could not execute query: ERROR: type "abstime" does not exist

I do understand that Data types abstime, reltime, and tinterval were removed by postgres under enhancements or version upgrades. but I believe there must be someone in the community who must have faced this issue and managed to find a solution to this problem.

is there anyone in community could help as would like to make progress and keep things secure.

tried to look into KB articles but couldn't find any solution. Looking for solution

答案1

得分: 1

替换所有的abstimetimestamp(0) with time zone。您需要在升级之前在v11数据库中执行此操作,除非您希望手动编辑一个转储文件。abstime在被移除时已经被弃用了近20年,而且存在Y2038问题。

英文:

Replace all occurrences of abstime with timestamp(0) with time zone. You'll have to do that in the v11 database before you upgrade, unless you want to manually edit a dump file.

abstime had been deprecated for almost 20 years when it was removed, and it had a Y2038 problem.

huangapple
  • 本文由 发表于 2023年5月25日 00:59:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76325871.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定