(Not sure if this should be on Stack Overflow or Super User... please move if needed.)

When I start the PostgreSQL service on Windows 7 x64, it immediately stops.
When I check my log folder (C:\PostgreSQL\9.1\data\pg_log\), I see new but empty log files.

The Event Viewer doesn't tell me anything other than the fact that the server did not respond.

I've even tried turning off my firewall (I don't have any antivirus or anything else), but nothing helps.

The setup works fine when I'm on Windows XP (32-bit) (same computer, different partition). I can't figure out what's wrong, even though I've tried tracing the system calls.

Is PostgreSQL compatible with Windows 7 x64 at all? Any ideas what the issue might be?

More info:

This problem also happens at the end of installation -- the service starts, then stops immediately, before the installer can do anything.

Installation log:

Starting the database server...
Executing cscript //NoLogo "C:\Program Files\PostgreSQL\9.1\installer\server\startserver.vbs" postgresql-x64-9.1
Script exit code: 0

Script output:
 Starting postgresql-x64-9.1
Service postgresql-x64-9.1 started successfully   // <==== NOT REALLY!! It stops!
startserver.vbs ran to completion

Script stderr:

Loading additional SQL modules...
Executing cscript //NoLogo "C:\Program Files\PostgreSQL\9.1\installer\server\loadmodules.vbs" "postgres" "****" "C:\Program Files\PostgreSQL\9.1" "C:\Program Files\PostgreSQL\9.1\data" 5432
Script exit code: 2

Script output:
 Installing the adminpack module in the postgres database...
    Executing 'C:\Users\HOMEUS~1\AppData\Local\Temp\rad6C20D.bat'...
psql: could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

Failed to install the 'adminpack' module in the 'postgres' database
loadmodules.vbs ran to completion

Script stderr:
 Program ended with an error exit code

Error running cscript //NoLogo "C:\Program Files\PostgreSQL\9.1\installer\server\loadmodules.vbs" "postgres" "****" "C:\Program Files\PostgreSQL\9.1" "C:\Program Files\PostgreSQL\9.1\data" 5432 : Program ended with an error exit code
link|improve this question
Just to check, have you downloaded the 64 bit version or trying to install the 32 bit version on 64? 32 bit generally works without any problems on 64 bit OS but for getting installed in a different folder. – Muthu Nov 25 '11 at 4:23
@Muthu: Yeah, it's the right version and everything. – Mehrdad Nov 25 '11 at 4:36
Do you set the parameter logging_collector to on in the postgresql.conf? – francs Nov 25 '11 at 6:09
@francs: Yeah, it's on.. – Mehrdad Nov 25 '11 at 6:34
Please check the Postgres logfile. You can also use pg_ctl (instead of starting the service) to start Postgres, that way you can see error messages directly in the command prompt. My bet is that the privileges on the data directory are not correct. You should verify that the Windows postgres user (the one that is used to start the service) has full read and write access to the data directory. – a_horse_with_no_name Nov 25 '11 at 7:44
show 5 more comments
feedback

migrated from stackoverflow.com Nov 25 '11 at 16:51

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

2 Answers

From one of the comments to the question:

You should verify that the Windows postgres user (the one that is used to start the service) has full read and write access to the data directory

That worked for me.

link|improve this answer
feedback

Is PostgreSQL compatible with Windows 7 x64 at all?

Yes, i have installed it in several machines ... The x64 version of course .

Any ideas what the issue might be?

I've faced a similar problem some times ago,you should try changing the user under which the service run from postgres(default) to LOCALSYSTEM account (i've resolved with that).

link|improve this answer
Nope, it doesn't work when I do that either. – Mehrdad Nov 25 '11 at 21:14
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.