【发布时间】:2017-09-28 21:12:20
【问题描述】:
调用时
from django.core.management import call_command
call_command('dbbackup', compress=True, interactive=False)
我明白了:
CommandConnectorError: Error running: pg_dump xxx --host=localhost --port=xxx --username=xxx --no-password --clean
pg_dump: server version: 9.6.5; pg_dump version: 8.4.20
pg_dump: aborting because of server version mismatch
我正在使用 PostgreSQL 的非 root 安装(版本 9.6.5)作为 django 应用程序的后端。 (安装时使用this教程。)
本机也有安装postgreSQL(版本8.4.20)。
在我切换到非 root 安装之前,一切正常。
我的猜测是在dbbackup 中调用的pg_dump 仍然是根安装中的那个。
如何指定使用哪个 pg_dump?
【问题讨论】:
标签: python postgresql centos pg-dump django-1.11