Starting the database server manually
Typically, the PostgreSQL server will start automatically when the system boots. You may have opted to stop and start the server manually, or you may need to start it up or shut it down for various operational reasons.
Getting ready
First, you need to understand the difference between the service and the server. The word server refers to the database server and its processes. The word service refers to the operating system wrapper by which the server gets called. The server works in essentially the same way on every platform, whereas each operating system and distribution has its own concept of a service.
Moreover, the way services are managed has changed recently: for instance, at the time of publication, most Linux distributions have adopted the systemd
service manager. This means that you need to know which distribution and release you are using to find the correct variant of this recipe.
With systemd
, a PostgreSQL server process is represented by a service...