删除完毕进行新版本程序安装,结果!惊人的一幕出现了…
根据postgresql-8.3安装程序报出的信息找到initdb.log,很关键的一行:
creating template1 database in E:/Program Files/PostgreSQL/8.3/data/base/1 … initdb: could not execute command ""E:/Program Files/PostgreSQL/8.3/bin/postgres.exe" –boot -x1 -F ": No error
也就是初始化集群数据时,运行:postgres.exe –boot -x1 -F 失败了,然后我用命令行手动运行该命令,报出无权限……
还好postgresql-8.3安装包中README文件帮了大忙,其中就有windows平台安装的常见问题列表,其中也正好包含了该现象:
问题列表地址:http://www.postgresql.org/docs/faqs.FAQ_windows.html
2.5) What filesystem permissions does PostgreSQL require?
要点:
PostgreSQL also needs read permissions on system DLL files like kernel32.dll and user32.dll (among others), which is normally granted by default, and on the CMD.EXE binary, which may in some scenarios be locked down and need opening.
3.4) I’m getting permissions errors when installing/running initdb
要点:
Make sure the PostgreSQL service account has permissions on the directories leading up to the one you have installed into. The installer will set permissions on the install directory but not on parent directories of it. See question 2.5 for a list of the required permissions.
根据系统环境检查:安装目的文件夹的权限;磁盘空间分配;kernel32.dll、user32.dll、cmd.exe可读和执行执行权限;结果是cmd.exe因为安全考虑,没有赋予除管理员任何用户执行和读取的权限,苍天呀大地呀,谢谢!!!
只要临时赋予postgresql用户cmd.exe读取和执行权限,运行安装程序,完毕后再修改回来就好了。