Jer*_*son 5 postgresql postgis
我正在尝试将 9.5 服务器升级到 9.6,并且 pg_upgrade 给了我以下错误:
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is the install user ok
Checking database connection settings ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for roles starting with 'pg_' ok
Creating dump of global objects ok
Creating dump of database schemas
ok
Checking for presence of required libraries fatal
Your installation references loadable libraries that are missing from the
new installation. You can add these libraries to the new installation,
or remove the functions using them from the old installation. A list of
problem libraries is in the file:
loadable_libraries.txt
Run Code Online (Sandbox Code Playgroud)
其中包含:
could not load library "$libdir/rtpostgis-2.2":
ERROR: could not access file "$libdir/rtpostgis-2.2": No such file or directory
Run Code Online (Sandbox Code Playgroud)
当我启动服务器并运行“CREATE EXTENSION postgis”然后停止服务器时,pg_upgrade 然后给我一个关于非空数据库的错误:
New cluster database "postgres" is not empty
Run Code Online (Sandbox Code Playgroud)
所以,我遇到了一个 catch-22 - 我不能在不安装扩展的情况下升级,但是一旦我这样做,它就会认为数据库不是空的。
任何提示如何解决这个问题?
小智 3
问题是旧集群中的postgis扩展版本与新集群中的库版本不一样。因此,当它尝试迁移数据库时,它无法找到旧版本的扩展。
要解决此问题,对于每个my_database
安装了 postgis 扩展的程序,运行:
psql my_database postgres -c 'ALTER EXTENSION postgis UPDATE TO "2.3.2";'
Run Code Online (Sandbox Code Playgroud)
在旧集群中。然后运行pg_update。
归档时间: |
|
查看次数: |
3998 次 |
最近记录: |