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, 2023 at 15:18

1 Answer 1


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

  • 1
    I was hesitating to do this, but you gave me courage. thanks bro. Mar 17, 2023 at 15:21
  • My pleasure :))
    – Saxtheowl
    Mar 17, 2023 at 15:23
  • As explained in kill -9 a postgres process it should not be used unless it doesn't react to SIGTERM. Mar 22, 2023 at 18:00
  • I updated to do just kill then
    – Saxtheowl
    Mar 22, 2023 at 19:25

You must log in to answer this question.

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