1

I did

pgsqld stop

and the command line was like

Stopping PostgreSql:

and I have waited for seconds, and I pressed ctrl+C to cancel it, because I just thought something is going wrong.

and I tried it again, then I saw the message like

pg_ctl: server does not shut down

and I checked the status

pgsqld status
// pg_ctl: server is running (PID: XXXXX)

In short, it seems the database is still running, and I cant shut down, BUT my service is dead now... please help me to shut down and start again.

++ when I tried to login to the pgsql server like

psql -U postgres
// FATAL: the database system is shutting down...
  • Next time, let it run. Don't run ctl-c unless its been more than 10 minutes or something... What does `ps aux | grep -i postgres' show? As Saxtheowl just mentioned, you need to identify the PID (and this is one way to help you do that). – David W Mar 17 '23 at 15:18

1 Answers1

0

There is different options you can try if the database is not shutting down properly:

first identify the PID

pg_ctl status

then try to kill it with its PID

kill [PID]

then you should be able to start your database again

Saxtheowl
  • 1,112
  • 5
  • 8