Error job for PostgreSQL, If you face this issue on your server means you need to check the status of your database server and logs to resolve this issue asap. PostgreSQL service failed or not found and you will have to initialize the database then you can connect to the Postgres database.
Once the database initialized then try to start the service and it will be running. you can also check the PID created at this location /var/run/. you can also manually create service if it does not work for you.
Error Job For Postgresql.service failed:
The world’s most advanced open-source database designed to handle a range of workloads, from a single machine to data warehouses. Easy to use and configure.
In my case, I found I did not initialize the database that is why I got this error postgresql.service failed.
So, you need to initialize the PostgreSQL server first then start the service.
Step 1: To initialize the database command is
postgresql-setup initdb # PostgreSQL Version 9.x
Another command is
service postgresql initdb # Redhat Version 6.x
Step 2: Now try to start PostgreSQL server
systemctl start postgresql
That’s it.postgresql service not found initialize database postgresql connect to postgres