[pgsql-jp: 40085] PostgreSQL-8.4.1 接続エラー

katagiri e.katagiri @ teikokupr.co.jp
2009年 11月 30日 (月) 16:21:59 JST


片桐です。

初めてポストします。よろしくお願いします。

Linux にインストールして使用しています。

使用環境: 
RHEL-5 + Python-3.1.1 + PostgreSQL-8.4.1 + pypostgresql-0.9.1
SELinux は disabled になっています。

インストールしたマシンでは、psql コマンドでテーブル定義が
可能です。しかし、他のLinuxマシンから接続を試みると、
次のようなエラーが出ます。

$ psql --host=sijdb sijihyo
psql: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

PostgreSQL-8.4.1 + pypostgresql-0.9.1
の組合せは、CentOS-5.4、RHEL-4.2、Vine Linux-4.2 で
問題なく動いています。PostgreSQLの設定ファイルは、殆ど同じ内容に
なっています。違うのは、ホスト名とデータベース名だけてす。

Python で接続しようとすると、下記のようなエラーになります。

$ python3
Python 3.1.1 (r311:74480, Oct 27 2009, 17:43:54) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import postgresql
>>> db = postgresql.open(user='katagiri', host='localhost', database='sijihyo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/python/lib/python3.1/site-packages/postgresql/__init__.py", line 78, in open
    c.connect()
  File "/opt/python/lib/python3.1/site-packages/postgresql/driver/pq3.py", line 1889, in connect
    raise err
postgresql.exceptions.ClientCannotConnectError: failed to establish connection to server
  CODE: 08001
  LOCATION: CLIENT
CONNECTION: [failed]
  failures[0]:
    NOSSL socket('127.0.0.1', 5432)
    postgresql.exceptions.ProtocolError: server did not support SSL negotiation
      CODE: 08P01
      LOCATION: CLIENT
      HINT: The server is probably not PostgreSQL.
  failures[1]:
    socket('127.0.0.1', 5432)
    postgresql.exceptions.ConnectionFailureError: unexpected EOF from server
      CODE: 08006
      LOCATION: CLIENT
      DETAIL: Zero-length read from the connection's socket.
CONNECTOR: [Host] pq://katagiri@localhost:5432/sijihyo
  category: None
DRIVER: postgresql.driver.pq3.Driver


アドバイスをお願いします。



pgsql-jp メーリングリストの案内