postgresql-embedded icon indicating copy to clipboard operation
postgresql-embedded copied to clipboard

PostgreSQL instance can not start due to missing postgresql.conf file (Windows 10)

Open tdziurko opened this issue 8 years ago • 1 comments
trafficstars

I have a strange problem with starting postgresql-embedded under Win10. It does not start and when I debug and captur exact command being called I got:

C:\Users\Tomek\AppData\Local\Temp\postgresql-embed-a0a6c49c-5653-48c9-a992-98fd43979b88\pgsql\bin\postgres.exe 
-p 64582 -h localhost 
-D C:\Users\Tomek\AppData\Local\Temp\postgresql-embed-a0a6c49c-5653-48c9-a992-98fd43979b88\db-content-1b058745-4905-4d72-81c1-6b35a43da9ce

And when I tried to execute manually it I got error:

postgres cannot access the server configuration file 
"C:/Users/Tomek/AppData/Local/Temp/postgresql-embed-a0a6c49c-5653-48c9-a992-98fd43979b88/db-content-1b058745-4905-4d72-81c1-6b35a43da9ce/postgresql.conf": 
No such file or directory

I have checked this path and no such file is there, I even tried running Windows with "Safe mode" to make sure that no other application inteferes, but the problem persists.

So my questions are:

  1. Does postgresql-embedded create such file and uses it somehow? I wasn't able to locate related code.
  2. Maybe it's a problem with / returned in error message instead of \, but I have checked both Powershell and Cmder and both return same stuff so I doubt that is related with my missing conf file problem.

Thank you in advance for help.

tdziurko avatar Mar 15 '17 19:03 tdziurko

@tdziurko

  1. This file is created by initdb command, which initializes a new database. postgresql-embedded typically initializes a new temporary database when test starts and then removes it after test has finished. So I assume you tried to run postgres against the removed database directory, that's why it could not find the configuration file.
  2. It should not be related. That was just a representation in the message.

Can you try to manually initialize a new database using initdb and then start the database? I think your problem is most likely with something else. For example, you may be trying to run postgres under the admin user, which is a known limitation.

smecsia avatar Mar 17 '17 00:03 smecsia