【发布时间】:2021-08-09 13:12:46
【问题描述】:
我正在尝试将我的 postgres 11 实例迁移到 12,遵循 https://stackoverflow.com/a/62198992 但我卡住了。 我做了一个备份,安装了 postgres 12
运行检查
/usr/lib/postgresql/12/bin/pg_upgrade --old-datadir=/var/lib/postgresql/11/main --new-datadir=/var/lib/postgresql/12/main --old-bindir=/usr/lib/postgresql/11/bin --new-bindir=/usr/lib/postgresql/12/bin --old-options '-c config_file=/etc/postgresql/11/main/postgresql.conf' --new-options '-c config_file=/etc/postgresql/12/main/postgresql.conf' -O "-c timescaledb.restoring=on" --check
返回一堆 'ok' 并且 集群是兼容的
然后在升级过程中,我得到错误:
pg_restore: from TOC entry 5992; 0 0 ACL FUNCTION "abstime"(timestamp without time zone) postgres
pg_restore: error: could not execute query: ERROR: function pg_catalog.abstime(timestamp without time zone) does not exist
Command was: GRANT ALL ON FUNCTION "pg_catalog"."abstime"(timestamp without time zone) TO "admin";
尝试谷歌搜索,但没有成功。有什么提示吗?
__
我转储了架构,这就是我找到 abstime 的地方
GRANT ALL ON FUNCTION pg_catalog.abstime(timestamp without time zone) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstime(timestamp with time zone) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimeeq(abstime, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimege(abstime, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimegt(abstime, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimein(cstring) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimele(abstime, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimelt(abstime, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimene(abstime, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimeout(abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimerecv(internal) TO admin;
GRANT ALL ON FUNCTION pg_catalog.abstimesend(abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.btabstimecmp(abstime, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.date(abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.date_part(text, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.intinterval(abstime, tinterval) TO admin;
GRANT ALL ON FUNCTION pg_catalog.isfinite(abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.mktinterval(abstime, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog."time"(abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.timemi(abstime, reltime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.timepl(abstime, reltime) TO admin;
GRANT ALL ON FUNCTION pg_catalog."timestamp"(abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.timestamptz(abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.tinterval(abstime, abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.max(abstime) TO admin;
GRANT ALL ON FUNCTION pg_catalog.min(abstime) TO admin;
__
编辑 2
深入挖掘,我发现 pg_shadow 和 pg_user 中的列 valuntil 属于 abstime 类型
有什么办法吗?
【问题讨论】:
-
As documented in the release notes abstime 数据类型已被删除。您需要将所有使用
abstime的表更改为使用不同的数据类型。 -
它在默认“postgres”数据库上创建 acl 的 pg_restore 崩溃,我该如何摆脱它
标签: postgresql upgrade postgresql-11 postgresql-12