postgres 9.2.1 のインスタンスをコンパイルしてインストールしました。そしてpython 2.7.3。OpenSuSE 12.2 では、xeon サーバーで実行されます。次に、pygresql をダウンロードし、pgdb を使用してデータベースに接続しようとしましたが、これにより python がクラッシュします。トレースは次のとおりです。
Retrieving package PyGreSQL-4.0-200.1.2.x86_64 (1/1), 85.0 KiB (402.1 KiB unpacked)
Retrieving: PyGreSQL-4.0-200.1.2.x86_64.rpm ........................................................[done]
Installing: PyGreSQL-4.0-200.1.2 ...................................................................[done]
rikki:~/Downloads # python
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pgdb
>>> c=pgdb.connect()
Segmentation fault
"" または localhost 以外のものを使用するか、"OK" で動作します。
rikki:~/Downloads # python
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pgdb
>>> d=pgdb.connect(host="localhost")
Segmentation fault
rikki:~/Downloads # python
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pgdb
>>> d=pgdb.connect(host="zzzzzzzzzzzzzzz")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/pgdb.py", line 482, in connect
dbtty, dbuser, dbpasswd)
pg.InternalError: could not translate host name "zzzzzzzzzzzzzzz" to address: Name or service not known
>>>
データベースにアクセスできます: rikki:~/Downloads # psql -U cw psql (9.2.2) ヘルプを表示するには、「help」と入力します。
cw=# select now();
now
------------------------------
2013-05-14 09:08:49.54825-07
(1 row)
cw=#
同時に、同様のインストールが正常に機能するデスクトップがあります。
インストールで何を確認する必要がありますか?
ありがとう。
--EDIT-- で試してみると、psycopg2-2.5-py2.7
同じ種類のエラーが発生します:
>>> con=psycopg2.connect(host="z",db="cw",user="cw")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib64/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: invalid connection option "db"
>>> con=psycopg2.connect(host="localhost",database="cw",user="cw")
Segmentation fault