Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I installed postgres on windows7 and tried to start the service through control panel. It produces error 1053.

When I try to run postgres.exe from command line, I get this message:

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

The default data directory is

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

I have set the PGDATA env variable to the above directory.

Also, I have edited the pg_hba.conf file in that directory to add a new line as below:

local   all postgres    ident  sameuser

I tried to start the service with postgresql server allowed (both private and public networks ticked) in Windows Firewall, and when that didn't solve the problem, turned off the firewall for both public and private networks..

Still the service cannot be started. I tried disabling the AVG resident shield. None of these worked.

Any idea what to do?


update:

I tried this:

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":

Still no luck.

As for the logs, I found 2 txt files in folder data/pg_log. They contain logs of events immediately after installation, not my later attempts at starting postgres. I have put it here.

In windows event viewer, I get a series of error event entries like http://pastebin.com/K6jUPPAy. All of them contain messages similar to:

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.

If there are any other logs, please tell me where I can find them.

share|improve this question

migrated from stackoverflow.com Jul 26 '11 at 3:20

This question came from our site for professional and enthusiast programmers.

1  
What's in the event log and the postgres' log? –  Milen A. Radev Jul 24 '11 at 9:17

2 Answers 2

up vote 1 down vote accepted

This is just a guess, but maybe PostgreSQL directory is set to be read-only. Read this post for more.

share|improve this answer
    
it is!I tried to change security permissions of the folder to full control but failed..I think I will crate another directory for data –  jimgardener Jul 24 '11 at 12:30

I just had the same error and in my case it was because I allocated too much memory (sort_mem and shared_buffers) to posgresql and somehow that prevented from starting. I just had to go back and replace posgresql.conf with the factory-default file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.