简体   繁体   English

AWS RDS Postgres PostGIS 升级问题

[英]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:如果我尝试“修改”,我会在预检查日志文件中收到以下错误:


Upgrade could not be run on Sun Sep 18 06:05:13 2022无法在 2022 年 9 月 18 日星期日 06:05:13 运行升级

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.请对使用与请求的主要引擎版本升级不兼容的数据库采取适当的措施,然后重试。

  • Following usages in database 'XXXXX' need to be corrected before upgrade: -- The instance could not be upgraded because there are one or more databases with an older version of PostGIS extension or its dependent extensions (address_standardizer, address_standardizer_data_us, postgis_tiger_geocoder, postgis_topology, postgis_raster) installed.升级前需要更正数据库“XXXXX”中的以下用法: -- 实例无法升级,因为有一个或多个数据库具有旧版本的 PostGIS 扩展或其依赖扩展(address_standardizer、address_standardizer_data_us、postgis_tiger_geocoder、postgis_topology、postgis_raster ) 安装。 Please upgrade all installations of PostGIS and drop its dependent extensions and try again.请升级 PostGIS 的所有安装并删除其依赖扩展,然后重试。 ----------------------- END OF LOG ---------------------- ---------------------- 日志结束 ----------------------

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:我最终通过以下方式解决了这个问题:

  1. Spinning up a new instance on the desired postgres version在所需的 postgres 版本上启动一个新实例
  2. Using pg_dump on the old version (schema and data)在旧版本(架构和数据)上使用 pg_dump
  3. Using pg_restore on the new version在新版本上使用 pg_restore

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.

相关问题 将 AWS RDS postgres db 与可写 RDS postgres db 同步 - Sync AWS RDS postgres db with writable RDS postgres db Terraform RDS 的 AWS 供应商升级问题 - Terraform AWS provider upgrade issue with RDS 如何调试高 CPU AWS RDS Postgres? - How to debug high CPU AWS RDS Postgres? 使用 Java 驱动程序连接到私有 AWS RDS Postgres - Connecting to Private AWS RDS Postgres using Java driver Cloud SQL 来自 AWS RDS Postgres 的 Postgres 外部复制 - 源表示实例的问题 - Cloud SQL Postgres external replication from AWS RDS Postgres - problem with source representation instance 在 RDS Postgres 上禁用触发器 - Disabling triggers on RDS Postgres 将 AWS DMS 用于 Postgres RDS 时如何修复“用户必须指定 LSN” - How to fix `user must specify LSN` when using AWS DMS for Postgres RDS Laravel 迁移未连接 AWS-RDS postgres(找不到驱动程序...)。 PDO 已经安装。 如何解决? - Laravel migrations is not connecting AWS-RDS postgres (could not find driver ...). PDO already installed. How to solve that? 为什么 AWS App runner 在可公开访问时无法连接到 RDS Postgres 数据库? - Why AWS App runner can't connect to RDS Postgres database when it is publicly accessible? 错误:尝试连接到 AWS RDS (Postgres) 时连接 ECONNREFUSED 127.0.0.1:5432 - Error: connect ECONNREFUSED 127.0.0.1:5432 when trying to connect to AWS RDS (Postgres)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM