Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres Installation Error reading file postgresql.conf

I have Windows Server 2003 machine on which I tried to install Postgres 9.2. At the end of the installation it pops a warning saying

Problem running post-install step. Installation may not complete correctly. Error reading file C:\Program Files\PostgreSQL\9.2\data\postgresql.conf

I checked for the file postgresql.conf in C:\Program Files\PostgreSQL\9.2\data and found that it does not exist.

I also found that there is not much under the data folder except for pg_log folder which is also empty.

Any ideas on what I may be doing wrong?

like image 605
Fawad Shah Avatar asked May 24 '13 08:05

Fawad Shah


3 Answers

I recommend you to try following, it worked for me:

Make sure that the user that is logged in to the server has full control permissions for the postgres folder and it's sub-folders.

Run:

initdb -D <your new data folder>

and then:

pg_ctl -D <your new data folder> -l logfile start

If the problem continues, and postgres is installed under "Program Files", or the installation path contains a space character, try using a relative path for the data folder argument of pg_ctl. Such as: "..\data"

like image 79
eaykin Avatar answered Sep 16 '22 19:09

eaykin


I just stumbled over another issue: If the user name of the currently active user contains a space character, postgres will fail to install its services to begin with, which results in the same error message. Be careful about changing the user name, as this might brick your windows installation. Instead, create a new user with admin privileges and install postgres from there, and everything will work smoothly.

On top of that, you will have to use a "runas /user:postgres cmd" to get a command window that's any good, or else initdb won't work either.

I realize this answer is months late, but it might help someone else!

like image 36
Kajetan Abt Avatar answered Sep 18 '22 19:09

Kajetan Abt


Had this problem on Windows 10. For me the solution was to choose a locale different from [Default Locale] during install.

like image 45
Vlad Avatar answered Sep 17 '22 19:09

Vlad