how to start and stop postgres server code example Example: restart postgresql sudo /etc/init.d/postgresql restart