This brief article shows how to restart PostgreSQL in Ubuntu.
Restarting PostgreSQL Server in Ubuntu
You can use the following command to restart the Postgres server in Ubuntu.
sudo service postgres restart
Sometimes the above command doesn’t work. The problem might arise that stuck in clustering after reboot.
To fix this issue, you can perform the following command.
sudo systemctl restart postgresql.service
If you want to automatically start the while boot up the Ubuntu, use the command below.
sudo systemctl enable postgresql