postgresql - 带有 PostgreSQL 8.4.20 和 PostGIS 2.2 的 Geodjango

标签 postgresql postgis geodjango

我正在尝试将 Geodjango 与较旧版本的 PostgreSQL (8.4.20) 一起使用。尝试将python生成的模型迁移到数据库(python manage.py migrate)时,抛出如下错误:

django.db.utils.ProgrammingError: syntax error at or near "EXTENSION"
LINE 1: CREATE EXTENSION IF NOT EXISTS postgis

根据 this answer ,这可能与我使用的是旧版本的 PostgreSQL/PostGIS 这一事实有关。但是因为我已经安装了 PostGIS,所以不需要 django 尝试的这个命令(CREATE EXTENSION IF NOT EXISTS postgis)。有解决办法吗?

最佳答案

这不足为奇,因为 Postgis 2.2 支持的最低 Postgresql 版本是 posgresql 9.1

根据Version Compatibilit Matrix您可能可以与 8.4 一起使用的最新版本的 Postgis 是 2.00,但这将是一项艰巨的工作。

关于postgresql - 带有 PostgreSQL 8.4.20 和 PostGIS 2.2 的 Geodjango,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38405283/

相关文章:

json - 将 JSON 映射到 PostgreSQL 中的列和行

python - 高效top K PostgreSQL

database - 杀死一个 postgresql session /连接

postgresql - 在postgresql中查找主机名

postgresql - Postgis上传大量空间数据有什么好方法?

hibernate - Wildfly 10 上的空间 hibernate 5

django - 如何修复 GeoDjango OSError : undefined Symbol?

python - 如何使用 PyQGIS 在 auth-manager 中获取加密密码?

windows - 如何在 Windows 上为 GeoDjango 安装 GEOS

gis - 是否有 PostGIS IDE 来执行 postgres gis 空间功能?