postgresql - pg_restore:错误:无法执行查询:错误:函数 public.st_accum(public.geometry) 不存在
问题描述
我正在尝试将备份从 pg11 postgis 2.5.2 恢复到 pg12 postgis 3.0.0,但恢复失败。
如果我在源服务器上删除 postgis 2.5.2 并安装 3.0.0 会导致问题吗?
细节:
源数据库(进行备份的地方):
PostgreSQL 11.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
POSTGIS="2.5.2 r17328" [EXTENSION] PGSQL="110" GEOS="3.7.1-CAPI-1.11.1 27a5e771" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL
1.11.4, released 2016/01/25" LIBXML="2.9.1" LIBJSON="0.11" RASTER
目标数据库(还原位置):
PostgreSQL 12.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit
POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="120" GEOS="3.8.0-CAPI-1.13.1 " SFCGAL="1.3.1" PROJ="6.2.1" LIBXML="2.9.1" LIBJSON="0
.11" LIBPROTOBUF="1.0.2" WAGYU="0.4.3 (Internal)" TOPOLOGY
转储文件:
Dump Version: 1.14-0
Format: CUSTOM
Integer: 4 bytes
Offset: 8 bytes
Dumped from database version: 11.1
Dumped by pg_dump version: 12.1
示例错误:
pg_restore: error: could not execute query: ERROR: function public.st_accum(public.geometry) does not exist
Command was: GRANT ALL ON FUNCTION public.st_accum(public.geometry) TO test_app;
pg_restore: error: could not execute query: ERROR: type "public.raster" does not exist
Command was: GRANT ALL ON FUNCTION public.st_countagg(public.raster, boolean) TO test_app;
解决方案
推荐阅读
- pandas - 根据 2 个 pandas 列的比较在 matplotlib 中绘制一条线
- discord - 我如何制作一个响应特定用户的机器人?不和谐.py
- c# - 在excel中更快地读取数据行的问题
- powerbi - 在直接查询模式下下载 Power BI 中的数据集块
- javascript - 将 ID 分配给为数据表动态创建的选项
- apache-spark - 在 dataproc 集群中,我在哪里配置 spark 执行器和 spark 作业的执行器内存?
- reactjs - 使用 Fetch 和 Typescript 进行类型推断
- php - 填充多级数组的键时保留重复键
- javascript - Javascript 剪贴板 API write() 在 Safari 中不起作用
- typescript - Typescript 可以自动检测函数参数的类型,然后在函数中使用这些类型吗?