Re: pg_ctl: server does not shut down - Mailing list pgsql-admin

From Greg Smith
Subject Re: pg_ctl: server does not shut down
Date
Msg-id 4CC5A0C6.8080901@2ndquadrant.com
Whole thread Raw
In response to pg_ctl: server does not shut down  ("Gnanakumar" <gnanam@zoniac.com>)
Responses Re: pg_ctl: server does not shut down
List pgsql-admin
Gnanakumar wrote:
> 1. What could be the root cause of PostgreSQL server not shutting
> down ever?
> 2. Am I following a different/incorrect way of disabling PITR?
>

You can check if PITR is disabled by executing:

SHOW archive_command;

At a psql prompt.  If that's empty, then you turned it off, and it isn't
involved in the shutdown issue you have anymore.

Normally when the server doesn't want to shut down, that's because of a
client that won't exit normally, not something in the main server.  Take
a look at what processes are still running against the database and see
if there are clients attached after the fast shutdown attempt.  If so,
those are your problem, not something to PITR.

If you know every client has been stopped or is doing nothing useful,
you can do an immediate shutdown of the server and kick everyone off.
You'll get messages about unclean shutdown, but no data should be lost.
The "service" scripts don't do that though.  You'll need to do something
like this instead, presuming you start as root:

su postgres
pg_ctl -D /var/lib/pgsql/data -m immedate stop

--
Greg Smith, 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services and Support  www.2ndQuadrant.us
Author, "PostgreSQL 9.0 High Performance"    Pre-ordering at:
https://www.packtpub.com/postgresql-9-0-high-performance/book


pgsql-admin by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Creating role using batch file in windows
Next
From: Nick
Date:
Subject: Re: autovacuum launcher process eating up 17G+ of ram?