3

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.

kvgr deepika
  • 45
  • 1
  • 6

2 Answers2

2

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*'
mivk
  • 13,452
  • 5
  • 76
  • 69
1

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).

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263