来源:http://trac.seagullproject.org/wiki/Howto/DB/PostgresSQL

PostgreSQL问题

下面是使用PostgreSQL可以出现的问题列表

1)配置SGL通过Unix socket连接PgSQL,选择5432端口,但是pg_hba.conf不允许用户使用密码或md5验证从本地连接进入。

php_log.txt文件如下:

May 24 13:32:44 Seagull [error] PEAR :: DB Error: connect failed :
[nativecode=Unable to connect to !PostgreSQL server: FATAL:  IDENT
authentication failed for user "seagull"]
May 24 13:32:44 Seagull [error] sgl_errorhandler->errhandler: DB Error:
connect failed

解决方案: 把pg_hba.conf中这行:

local all all ident sameuser

改成: local all all md5

否则如果你已经配置了密码/md5验证,就用tcp连接,

2) 配置SGL通过Unix socket连接PgSQL,不选择tcp5432端口。

在php_log.txt中:

May 24 13:37:48 Seagull [error] PEAR :: DB Error: connect failed :
[nativecode=Unable to connect to !PostgreSQL server: could not connect to
server: DÛ
<80>nÔ·@xÔ·@xÔ·<80>nÔ·(rÿ¿ÄäÔ×ËmÈ·@xÔ·P|Ü^Th·
        Is the server running locally and accepting
        connections on Unix domain socket
&quot;/var/run/postgresql/.s.PGSQL.3306&quot;?]
May 24 13:37:48 Seagull [error] sgl_errorhandler->errhandler: DB Error:
connect failed

好像SGL连接到错误tcp端口(3306)。 在我的mysite.default.conf.ini配置中:

[db]
type=pgsql
host=localhost
protocol=unix
port=3306
user=seagull
pass=seagull
name=seagull
bootstrap=0

而且我的观点似乎被证实了,因为port=3306。

在其它的配置中,添加一个组织也会正常工作。PgSQL配置成只对tcp连接进行密码/md5验证而且在tcp连接配置成5432端口SGL也能正常工作。

3) Instalation fails with translated error messages (Probed with Debian Sarge 3.1)

如果PostgreSQL是配置成用除英语之外所有语言输出错误信息,那么PEAR将无法正确解析错误信息。

把下面这行添加(或注释)到postgresql.conf文件就可解决这个问题

lc_messages = 'C'               # locale for system error message strings

4) 表名前缀

从eagull 0.6.2版本开始有一个新的特性:“表名前缀”。要想在PostgreSQL中使用这个特性,在module.data.pg.sql文件中的子查询必须写成一行。

 
howto/db/postgressql.txt · 最后更改: 2010/05/30 00:21 (外部编辑)
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2