标签归档:PostgreSQL

Win2003系统不能安装PostgreSQL 8.x的问题解决

PostgreSQL 8.4.2发布了,于是去官方下载了Win版本做测试,
在Win2003上面怎么也安装不上,提示错误为:
Problem running post-install step
Installation may not complete correctly
The database cluster initialisation failed

安装了很多遍,依然如故,百思不得其解,只好求助Google。
Google告诉我,在Postgre官方社区上有很多跟我同样的问题,
看了看大意,无非是让去/tmp中找一个长得像bitrock_installer.log的日志文件,
然后根据详细错误信息作进一步判断。

好吧,我去找,但/tmp是Linux的临时目录,Win2003的应该是Temp吧,
经过了我很暴力的查找手段,果然找到了bitrock_installer_xxxx.log文件,
在日志文件中找到那么一段记录:
initializing pg_authid … FATAL: database locale is incompatible with operating system
DETAIL: The database was initialized with LC_COLLATE “Chinese_Peoples Republic of China.936”, which is not recognized by setlocale().
HINT: Recreate the database with another locale or install the missing locale.
child process exited with exit code 1
initdb: removing contents of data directory “C:/Program Files/PostgreSQL/8.4/data”
Failed to initialise the database cluster with initdb
Script stderr:
Program ended with an error exit code
Error running cscript //NoLogo “C:ProgramFilesPostgreSQL8.4/installer/server/initcluster.vbs” “postgres” “postgres” “test” “C:Program FilesPostgreSQL8.4” “C:ProgramFilesPostgreSQL8.4data” 5432 “DEFAULT” : Program ended with an error
exit code
Problem running post-install step. Installation may not complete correctly
The database cluster initialisation failed.

看来是database locale设置问题,不能选default了,我选择了Chinese,选C也行,
剩下的一切顺利。

Postgres非常棒,有很多MySQL没有的高级特征,很多地方像Oracle,
与PHP使用也 很方便,在MySQL命运未知的情况下,PostgresSQL成了低成本高性能的首选.