From an operating system point of view, PostgreSQL is a service that can be started, stopped, and, of course, monitored. As you saw in the previous chapter, usually when you install PostgreSQL, you also get a set of operating system-specific tools and scripts to integrate PostgreSQL with your operating system service management (for example, systemd service files).
In particular, PostgreSQL ships with a tool called pg_ctl that helps in managing the cluster and the related running processes. This section introduces you to the basic usage of pg_ctl and to the processes that you can encounter in a running cluster.
pg_ctl
The pg_ctl command-line utility is a tool that allows you to perform different actions on a cluster, mainly initialize it, start it, restart and stop it, and so on. pg_ctl accepts the command to execute as the first argument, followed by other specific arguments—the main commands are as follows:
- start, stop, and restart execute the corresponding...