"pg_ctl stop" never stops

Posted on 2005-04-11
Last Modified: 2012-06-27
"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?
Question by:HappyEngineer
    LVL 22

    Expert Comment

    by:earth man2
    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
    LVL 22

    Accepted Solution

    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

    Author Comment

    "-m fast" did it!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: ( This requires some add-o…
    Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
    Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now