0

I'm trying to set up a PostgreSQL server on my PC, but I keep getting this error message when I try to start it from services.msc:

The postgresql-x64-13 - PostgreSQL Server 13 service on Local Computer started and then stopped. Some services stop automatically if they ae not in use by other services or programs.

I checked the logs in ~/PostgreSQL/13/data/, and they all followed a consistent pattern:

2021-05-05 19:32:12.676 BST [14144] LOG:  starting PostgreSQL 13.2, compiled by Visual C++ build 1914, 64-bit
2021-05-05 19:32:12.678 BST [14144] LOG:  listening on IPv6 address "::", port 5433
2021-05-05 19:32:12.679 BST [14144] LOG:  listening on IPv4 address "0.0.0.0", port 5433
2021-05-05 19:32:12.690 BST [14144] LOG:  could not open configuration file "C:/Program Files/PostgreSQL/13/data/pg_hba.conf": No such file or directory
2021-05-05 19:32:12.691 BST [14144] FATAL:  could not load pg_hba.conf
2021-05-05 19:32:12.694 BST [14144] LOG:  database system is shut down

The thing is, I have a pg_hba.conf file already. I did edit it a bit to fix a different issue, but I kept a backup of the original which I've restored but to no avail. I'm honestly getting a headache worrying about this.

3
  • Have you checked that C:/Program Files/PostgreSQL/13/data/pg_hba.conf exists? If so, maybe check if file permissions are set in a way postgres can reach/read the file.
    – Zenithies
    May 5, 2021 at 19:01
  • Perhaps a problem with the forward slashes or the space in "Program Files" ? Could you try placing pg_hba.conf in another folder? May 5, 2021 at 19:28
  • Yes, I can confirm that it exists.
    – CiaranC94
    May 5, 2021 at 19:37

0

You must log in to answer this question.

Browse other questions tagged .