postgresql-embedded
postgresql-embedded copied to clipboard
PostgreSQL instance can not start due to missing postgresql.conf file (Windows 10)
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:
- Does postgresql-embedded create such file and uses it somehow? I wasn't able to locate related code.
- 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
- This file is created by
initdbcommand, 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. - 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.