---
title: "ror连接postgresql所报BUG"
author: "together"
date: "2006-12-31T17:18:02Z"
tags: []
slug: "ror-postgresql-bug"
draft: false
lastmod: "2006-12-31T17:18:02Z"
id: 41872
url: "https://together.iteye.com/blog/41872"
---

redhat AS4
pg:8.2
ruby:1.8.5
rails:1.1.6
postgres0.7.1

在今天上午还能正常连接。我把ror环境重新配置了之后，就再也连接不上PG了。
$RUBY_HOME/lib/ruby/site_ruby/1.8/active_record/connection_adapters/**postgresql_adapter.rb:24:  Segmentation fault**
ruby 1.8.5 (2006-08-25) 

在PG的后台，打印出来的是：<span style="color:red">LOG:  unexpected EOF on client connection</span>

配置文件development:
  adapter: postgresql
  host: localhost
  database: ddd
  username: test
  password: test
  encoding: utf8

当adapter/host/database/username各项有错误时，均会报错。并可以判断出能否连接到指定host的指定database，也可判断出username是否存在。说明是可以正常连续到数据库的。应该是在判断password的地方，出现了错误。奇了怪了。

到网上搜索了半天，没找到什么有价值的信息。倒发现这好像还是一个比较常见的问题 :( 
现在连接mysql或oracle还是正常的。怎么回事呢？PG用客户端连接或者JDBC连接都是正常的。