Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql status is active and exited

Postgresql service status is active but excited ,because of that i am getting an error while running thingsboard. Error from thingsboard and postgress status:

Caused by: org.postgresql.util.PSQLException: ERROR: column a.propagate_to_owner does not exist

postgresql status: ● postgresql.service - PostgreSQL RDBMS Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled) Active: active (exited) since Sun 2022-02-13 15:28:46 IST; 27s ago Process: 161729 ExecStart=/bin/true (code=exited, status=0/SUCCESS) Main PID: 161729 (code=exited, status=0/SUCCESS)

systemd[1]: Starting PostgreSQL RDBMS... systemd[1]: Finished PostgreSQL RDBMS.

can anyone help me how to restart postgresql without loosing my data.

like image 712
kvgr deepika Avatar asked Sep 14 '25 06:09

kvgr deepika


2 Answers

As explained in this answer (or this), the postgres service is only used to start/stop the individual PostgreSQL services that depend on it.

To see the real status of your database cluster(s) service(s), use

systemctl status 'postgresql*'
like image 168
mivk Avatar answered Sep 16 '25 20:09

mivk


Don't let systemd confuse you.

Locate the PostgreSQL data directory and look for the postmaster.pid file there. See if the process mentioned there is running and is a PostgreSQL process. Then you know if PostgreSQL is running or not.

If it is running, and systemd thinks it is not, then PostgreSQL was probably started in some other fashion. Shutting down PostgreSQL and starting it viw systemctl usually fixes the problem.

If PostgreSQL is not running, figure out why. First, look at the PostgreSQL log – the problem might become apparent right away. If that does not solve the mystery, figure out how PostgreSQL is started in the systemd service file and repeat that process manually. The resulting error messages should clarify what the problem is (often, a broken configuration).

like image 20
Laurenz Albe Avatar answered Sep 16 '25 22:09

Laurenz Albe