Postgresql – How to restart server without rebooting system

postgresqlpostgresql-9.6

Local server
PostgreSQL\9.6
PgAdmin 4 v3.2

A least once an hour pgadmin gives me an out of memory error followed by "Not connected to the server or the connection to the server has been closed.". The only way I know to recover is to reboot my system.
I know I may have other issues, like why am I running out of memory and why am I losing the connection but for right now I just want to know if there another way of restarting the server afresh without rebooting?
If so, please explain in simple newbie terms 🙂

Best Answer

On CentOS server, you can use these below commands:

PostgreSQL 9.6:

/bin/systemctl restart postgresql-9.6.service

PostgreSQL 10.x

/bin/systemctl restart postgresql-10.service

PostgreSQL 11.x

/bin/systemctl restart postgresql-11.service