带有 PostgreSQL 8.4.20 和 PostGIS 2.2 的 Geodjango

Geodjango with PostgreSQL 8.4.20 and PostGIS 2.2

我正在尝试将 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,但这将是一项艰巨的工作。