postgresql - 使用 Postgis 对象迁移旧 PostgreSQL 数据库时出错

标签 postgresql migration postgis

我们有一个运行 PostgreSQL 8.3 的非常古老的 Linux 系统。该系统包含一个具有 Postgis 功能的数据库,但是,从 pgAdmin III 界面来看,似乎没有启用“扩展”。那台服务器机器即将过时,我们想转移到另一台 Postgres 服务器。

目前我们有一个 Windows 服务器 Postgres 9.3。我已经能够创建自定义 .backup 文件,并且能够使用以下方法导入大部分表和数据:http://trac.osgeo.org/postgis/wiki/UsersWikiWinUpgrade但我的 error.txt 文件说:

function makepoint(double precision, double precision) does not exist

而且我认为此函数是 liblwgeom.dll 的一部分,但我无法在任何地方找到该 DLL 文件!我已经完成了大部分的 zip 下载:http://download.osgeo.org/postgis/windows/但没有运气。

原始数据库确实具有如下所示的“makepoint”函数,但由于缺少 DLL,它无法在目标 Windows 系统上运行。

我有哪些选择?

也许需要一种不同的方法。请注意,根据 http://www.postgis.org/documentation/manual-svn/postgis_installation.html#hard_upgrade我也曾在 Linux 环境中使用 .backup 文件尝试过“硬升级”,但出现了一些错误,如“无效 header ”,这可能是由于 pg 恢复工具太新;在 Linux 中,我的进步远低于在 Windows 中。

CREATE OR REPLACE FUNCTION makepoint(double precision, double precision)
RETURNS geometry AS '$libdir/liblwgeom', 'LWGEOM_makepoint'
LANGUAGE c IMMUTABLE STRICT COST 1; ALTER FUNCTION makepoint(double   precision, double precision)  OWNER TO postgres;

编辑 这是 Windows 系统,因此建议的 Mac OS 建议无效。不过谢谢。

最佳答案

回到 PostGIS 1.2.3,函数被重命名为 ST_ 前缀,所以 makepoint(float8, float8) 的现代名称是 st_makepoint(float8 , float8).

您可以将函数使用的地方重命名为现代命名方案,尽管如果您有各种函数、触发器函数等,这可能很难做到。

您还可以运行安装 PostGIS 时附带的 legacy.sql 启用程序脚本,这将重新启用旧功能,例如 makepoint(float8, float8) 和许多其他人。

关于postgresql - 使用 Postgis 对象迁移旧 PostgreSQL 数据库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29614512/

相关文章:

excel - Postgres 小数精度 VS Excel

security - 什么取代了 Java 的 sun.security 包?

ios - 类型 ... 模棱两可,没有更多上下文

postgresql - 构建 postgis 2.0.0 失败

macos - PostreSQL93 + postgis2 使用 MacPorts

postgresql - 将文件从 Sqlite3 转储到 PostgreSQL : why do I always get errors when import it?

sql - 努力将数据集从行旋转到列

python - 字段子类的子类没有新的迁移

postgresql - 将两个数据字段插入到具有相同投影的 PostGis 中的单个数据字段中

ruby - 为什么我可以从 JSONB 值更新 PostgreSQL 列字符串而不是 Sequel 中的整数?