• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 858
  • Last Modified:

"pg_ctl stop" never stops

"pg_ctl stop" never stops postgres. (this is on a Linux server) I always end up needing to use "kill" which is something I don't want to do. Since the postgres tips specifically say to never do "kill -9", I assume that killing postgres is a bad thing to do.

So, how do I make "pg_ctl stop" actually stop postgres? If it doesn't work, what alternative to "kill" do I have?
  • 2
1 Solution
earth man2Commented:
as root
service postgresql stop

why won't pg_ctl stop work ?  You should be getting some kind of error message in your log files
earth man2Commented:
You probably have "clients" connected.
pg_ctl --help

you probably need to add the -m fast qualifier
pg_ctl stop -D $PGDATA -m fast

if that fails then if you're desperate do
pg_ctl stop -D $PGDATA -m immediate
HappyEngineerAuthor Commented:
"-m fast" did it!

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now