Use services (start -> run -> services.msc) and look for the postgresql-[version] service.
- If it is not there you might have just installed pgAdmin and not installed PostgreSQL itself.
- If it is not running try to start it, if it won't start open the event-viewer (start -> run -> eventvwr) and look for error messages relating to the PostgreSQL service.
- If it does start check the startup type, if you want it to start with windows it should be "Automatic"; or perhaps "Automatic, delayed start" if you don't want it to slow down startup too much.
Adding to the first, because in a different comment you've said the service isn't there. It is possible to download a standalone pgAdmin so you can connect to an external PostgreSQL database. It would seem you have done such a thing, or explicitly chosen to not add the service. Just try the One Click Installer, which still allows proper configuration of installation directory despite its name.
The Homebrew package manager includes launchctl plists to start automatically. For more information, run brew info postgres
.
Start manually
pg_ctl -D /usr/local/var/postgres start
Stop manually
pg_ctl -D /usr/local/var/postgres stop
Start automatically
"To have launchd start postgresql now and restart at login:"
brew services start postgresql
What is the result of pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
?
What is the result of pg_ctl -D /usr/local/var/postgres status
?
Are there any error messages in the server.log?
Make sure tcp localhost connections are enabled in pg_hba.conf:
# IPv4 local connections:
host all all 127.0.0.1/32 trust
Check the listen_addresses and port in postgresql.conf:
egrep 'listen|port' /usr/local/var/postgres/postgresql.conf
#listen_addresses = 'localhost' # What IP address(es) to listen on;
#port = 5432 # (change requires restart)
Cleaning up
PostgreSQL was most likely installed via Homebrew, Fink, MacPorts or the EnterpriseDB installer.
Check the output of the following commands to determine which package manager it was installed with:
brew && brew list|grep postgres
fink && fink list|grep postgres
port && port installed|grep postgres
Best Answer
On windows, Just go to the 'Services'. Start/Restart the postgresql-X64 service. It worked for me as my service was in stopped state somehow.