尝试在Windows上启动postgres作为服务的错误1053

我在windows7上安装了postgres,并试图通过控制面板启动服务。 它产生错误1053。

当我尝试从命令行运行postgres.exe时,我收到以下消息:

C:\Program Files (x86)\PostgreSQL\9.0\bin>postgres.exe 2011-07-24 14:02:29 IST LOG: could not create file "postmaster.opts": Permission denied 

默认的数据目录是

 C:\Program Files (x86)\PostgreSQL\9.0\data 

我已经将PGDATA envvariables设置为上述目录。

另外,我编辑了该目录中的pg_hba.conf文件,添加一个新行,如下所示:

 local all postgres ident sameuser 

我试图用Windows防火墙允许postgresql服务器(包括私人和公共networking打勾)启动服务,当没有解决问题时,closures公共和私人networking的防火墙。

仍然服务不能启动。 我试图禁用AVG驻地盾牌。 这些都没有工作。

任何想法该怎么办?


更新:

我试过这个:

 C:\Program Files (x86)\PostgreSQL\9.0\bin>pg_ctl restart pg_ctl: PID file "C:/Program Files (x86)/PostgreSQL/9.0/data/postmaster.pid" does not exist Is server running? starting server anyway server starting C:\Program Files (x86)\PostgreSQL\9.0\bin>2011-07-24 16:12:57 IST LOG: could not create file "postmaster.opts": 

仍然没有运气。

至于日志,我发现文件夹data/pg_log有2个txt文件。 他们包含安装后立即事件日志,而不是我以后尝试启动postgres。 我已经把它放在这里了 。

在Windows事件查看器中,我收到了一系列错误事件条目,如http://pastebin.com/K6jUPPAy 。 它们都包含类似于以下内容的消息:

 2011-07-24 12:46:44 IST FATAL: could not access status of transaction 0 2011-07-24 12:46:44 IST DETAIL: Could not open file "pg_notify/0000": Permission denied. 

如果还有其他日志,请告诉我在哪里可以find它们。

这只是一个猜测,但也许PostgreSQL目录设置为只读。 阅读这篇文章的更多。

我只是有同样的错误,在我的情况下,这是因为我分配了太多的内存(sort_mem和shared_buffers)posgresql,并以某种方式阻止启动。 我只好回去用出厂默认文件replaceposgresql.conf。

祝你好运