【发布时间】:2013-03-26 09:58:20
【问题描述】:
我猜这是一个非常基本的问题,但我不知道为什么:
import psycopg2
psycopg2.connect("postgresql://postgres:postgres@localhost/postgres")
出现以下错误:
psycopg2.OperationalError: missing "=" after
"postgresql://postgres:postgres@localhost/postgres" in connection info string
有什么想法吗?根据the docs about connection strings,我相信它应该可以工作,但它只是这样:
psycopg2.connect("host=localhost user=postgres password=postgres dbname=postgres")
我在 Ubuntu12.04 上的 Python2.7.3 上使用最新的 psycopg2 版本
【问题讨论】: