• Home »
  • Errors »
  • pg_ctl: Server Does Not Shut Down – Force Postgres to Shutdown

pg_ctl: Server Does Not Shut Down – Force Postgres to Shutdown

You might see the following when issuing the normal stop command to postgres via pg_ctl.

-bash-3.1$ pg_ctl stop
waiting for server to shut down……………………………………………………… failed
pg_ctl: server does not shut down

Sometimes postgres does not want to shutdown by just issuing a pg_ctl stop as the postgres user. User might feel the need to “kill -9″ the postgres processes however this could be dangerous for PostgreSQL. Instead of trying to kill the PID follow the directions below in an attempt to stop postgres in an organized fashion.

  1. Attempt Normal Stop: bash-3.1$pg_ctl stop
  2. Attempt Smart Stop: bash-3.1$pg_ctl stop -m s
  3. Attempt Fast Stop: bash-3.1$pg_ctl stop -m f
  4. Attempt Immediate Stop: bash-3.1$pg_ctl stop -m i

The immediate stop almost always ends up stopping postgres if you are having trouble in stopping the processes. If the immediate stop does not work the issue should be investigated before attempting to kill -9 the PID.

SQL in a Nutshell (In a Nutshell (O'Reilly)) (Paperback)

By (author): Kevin Kline, Brand Hunt, Daniel Kline


List Price: $44.99 USD
New From: $24.31 USD In Stock
Used from: $8.79 USD In Stock

SQL Cookbook (Cookbooks (O'Reilly)) (Paperback)

By (author): Anthony Molinaro


List Price: $39.95 USD
New From: $20.99 USD In Stock
Used from: $16.99 USD In Stock

Share