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 super user privileges, after replacing SERVICEUNIT with the appropriate systemd service unit name.

The systemctl command must always be issued with operating system super user 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.

Get PostgreSQL Administration Cookbook, 9.5/9.6 Edition 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.