3

Whenever I try to start my project the following error occurs.

django.db.utils.OperationalError: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

This is the status of postgres:

● postgresql.service - PostgreSQL RDBMS
  Loaded: loaded (/lib/systemd/system/postgresql.service; disabled; vendor preset: enabled)
  Active: inactive (dead)

And it will only work when I restart the service, how can I avoid restarting it every time I turn on my laptop could it be that the installation is wrong?

I'm using Ubuntu 18

1 Answer 1

6

The output you showed from systemctl status postgresql indicates that it is "disabled", meaning it will not start by default:

Loaded: loaded (/lib/systemd/system/postgresql.service; disabled;

Enable the service to let it start at boot:

sudo systemctl enable postgresql

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .