我在亚马逊EC2上运行着一个正在运行的PostgreSQL服务器。我使用在我的Mac上直接配置在pgAdmin3中的ssh隧道连接到它。 我可以进行查询并查看完整的模式,这没有任何问题。
如果我尝试从pgAdmin3 GUI备份数据库,即使连接实际上是打开和工作的,我也会得到以下异常:
/Applications/pgAdmin3.app/Contents/SharedSupport/pg_dump --host localhost --port 5432 --username "MY_USERNAME" --role "MY_ROLE" --no-password --format custom --encoding UTF8 --verbose --file "/Users/XXX/filename" "DATABASENAME"
pg_dump: [archiver (db)] connection to database "DATABASENAME" failed: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Process ended with Exitcode 1.