Deploy on Windows
Postgres files are generally stored at the following location
To check the status of the server, use the Windows Services utility. To access Services,
Press Windows + R Enter services.msc
pg_ctl can be used to initialize, start, stop or control a Postgres server. Note you will need to set the environment variable PGData, using the following command
set PGDATA=C:\Program Files\PostgreSQL\14\data
Installation on WSL
Microsoft offers a detailed guide for installing Postgres on WSL. In addition to the steps listed on the Microsoft website, I found it necessary to complete the following steps.
The authentication config file is located at
/etc/postgresql/10/main/pg_hba.conf, or a similar location. Change the authentication method from
trust. Specifically, I changed these two lines
local all postgres peer local all all peer
local all postgres trust local all all trust
Reload, and restart the server for the changes to take effect.
sudo /etc/init.d/postgresql reload sudo service postgresql restart