[英]AWS RDS Postgres PostGIS upgrade problems
I have an RDS instance running Postgres 11.16.我有一个运行 Postgres 11.16 的 RDS 实例。 I'm trying to upgrade it to 12.11 but it's giving me errors on PostGIS.
我正在尝试将其升级到 12.11,但在 PostGIS 上出现错误。 If I try a "modify" I get the following error in the precheck log file:
如果我尝试“修改”,我会在预检查日志文件中收到以下错误:
The instance could not be upgraded from 11.16.R1 to 12.11.R1 because of following reasons.由于以下原因,实例无法从 11.16.R1 升级到 12.11.R1。 Please take appropriate action on databases that have usages incompatible with requested major engine version upgrade and try again.
请对使用与请求的主要引擎版本升级不兼容的数据库采取适当的措施,然后重试。
First, I tried just removing postgis to upgrade then add it back again.首先,我尝试只删除 postgis 进行升级,然后再将其添加回去。 I used:
drop extension postgis cascade;
我用过:
drop extension postgis cascade;
. . However, this generated the same error
但是,这产生了同样的错误
Second, I tried running SELECT postgis_extensions_upgrade();
其次,我尝试运行
SELECT postgis_extensions_upgrade();
. . However, it gives me the following error:
但是,它给了我以下错误:
NOTICE: Updating extension postgis_raster from unpackaged to 3.1.5
ERROR: function st_convexhull(raster) does not exist
CONTEXT: SQL statement "ALTER EXTENSION postgis_raster UPDATE TO "3.1.5";"
PL/pgSQL function postgis_extensions_upgrade() line 82 at EXECUTE
SQL state: 42883
Third, I tried to do a manual snapshot and upgrade the snapshot.第三,我尝试做一个手动快照并升级快照。 Same results.
相同的结果。
One additional piece of information, I ran SELECT PostGIS_Full_Version();
一条附加信息,我运行了
SELECT PostGIS_Full_Version();
and this is what it returns:这就是它返回的内容:
"POSTGIS=""3.1.5 c60e4e3"" [EXTENSION] PGSQL=""110"" GEOS=""3.7.3-CAPI-1.11.3 b50468f"" PROJ=""Rel. 5.2.0, September 15th, 2018"" GDAL=""GDAL 2.3.1, released 2018/06/22"" LIBXML=""2.9.1"" LIBJSON=""0.12.1"" LIBPROTOBUF=""1.3.0"" WAGYU=""0.5.0 (Internal)"" TOPOLOGY RASTER (raster lib from ""2.4.5 r16765"" need upgrade) (raster procs from ""2.4.4 r16526"" need upgrade)"
As you'll notice, the raster lib is old but I can't really figure out how to upgrade it.您会注意到,光栅库很旧,但我真的不知道如何升级它。 I think this is what is causing me problems but I don't know how to overcome it.
我认为这是导致我出现问题的原因,但我不知道如何克服它。
I appreciate any thoughts.我很感激任何想法。
I ended up finally giving up on this after many failed attempts.经过多次失败的尝试,我最终放弃了这个。 I ended up solving this by:
我最终通过以下方式解决了这个问题:
I'm not sure if I did something wrong with the above but I found my sequences were out of sync on a number of tables.我不确定我是否在上面做错了什么,但我发现我的序列在许多表上不同步。 I wrote some scripts to reset the sequence values after doing this.
执行此操作后,我编写了一些脚本来重置序列值。 I had to use something like this to re-sync those sequences:
我不得不使用这样的东西来重新同步这些序列:
SELECT setval('the_sequence', (SELECT MAX(the_primary_key) FROM the_table)+1);
I wasted enough time and this got me past the issue.我浪费了足够多的时间,这让我解决了这个问题。 Hopefully the next upgrade doesn't give me this much trouble.
希望下一次升级不会给我带来这么多麻烦。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.