我的一台服务器最近在尝试使用 manage.py 中的任何与南方相关的命令时开始出现错误
$ python ./manage.py migrate
TypeError: invalid postgreSQL type: bigint
$ python ./manage.py syncdb
TypeError: invalid postgreSQL type: bigint
$ python ./manage.py shell
TypeError: invalid postgreSQL type: bigint
设置:django、postgis、south、ubuntu。
令人困惑的是,这台服务器最近没有任何变化,其他 3 台设置应该完全相同的服务器正常工作。
我打开了 postgres 语句日志记录,但我没有看到任何明显的错误:
2013-09-24 16:33:14 UTC LOG: statement: SHOW default_transaction_isolation
2013-09-24 16:33:14 UTC LOG: statement: SET default_transaction_isolation TO DEFAULT
2013-09-24 16:33:14 UTC LOG: statement: SET TIME ZONE 'America/Chicago'
2013-09-24 16:33:14 UTC LOG: statement: SET default_transaction_isolation TO 'read committed'
2013-09-24 16:33:14 UTC LOG: statement: BEGIN
2013-09-24 16:33:14 UTC LOG: statement: SELECT postgis_lib_version()
来自settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'redacted',
'USER': 'redacted',
'PASSWORD':'...',
'HOST': 'localhost',
'PORT': '5432',
}
}
postgres 版本:
psql (9.1.9)
Type "help" for help.
redacted=# select version();
version
------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.9 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit
(1 row)
redacted=# select postgis_lib_version();
postgis_lib_version
---------------------
2.0.1
(1 row)
Django-1.5.4
Python 2.7.3