How to restart PostgreSQL via ssh console?
When i search this thing on SO I only find: postgres, ubuntu how to restart service on startup? get stuck on clustering after instance reboot
Getting a PostgreSQL command prompt You can get a command shell in Windows by running cmd.exe. The CSEP544 shell launcher script will also open a shell for you. Type psql -U postgres at the prompt, and hit Enter. Here, postgres represents the username of the database superuser.
sudo service postgresql restart
systemctl restart postgresql@<postgres_version>-<cluster_name>.service
By default cluster_name = 'main', run this command to list all the clusters you have :
ls /var/lib/postgresql/
if you want to know whether the postgresql is running try this command :
systemctl status postgresql@<postgres_version>-<cluster_version>.service
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With