How to do it…

On each platform there is a specific command to start the server.

If you are using a modern Linux distribution, you are probably using systemd. In this case, PostgreSQL can be started with the following command:

systemctl start SERVICEUNIT

This must be issued with OS superuser privileges, after replacing SERVICEUNIT with the appropriate systemd service unit name.

The systemctl command must always be issued with operating system superuser privileges. Remember, throughout this book we will always prepend systemctl invocations with sudo.

There are a couple of things to keep in mind:

  • This will work only if the user executing the command has been previously granted appropriate sudo privileges by the system administrator
  • If the command ...

Get PostgreSQL 10 Administration Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.