Thread: pg_ctl stop returns error

pg_ctl stop returns error

From
Murakami
Date:
 I've just installed postgreSQL_7.0.3 to my Solaris7.
 I can start DB with "postmaster" or "pg_ctl -w start" and create DB with no problem.
 But when I try to stop DB with "pg_ctl -w stop", it returns an error.
 Error is "Waiting for postmaster shutting down.....pg_ctl: postmaster does not shut down"

 Does anyone know about this error?
 Please advise.

Murakami

Re: pg_ctl stop returns error

From
Tom Lane
Date:
Murakami <exit@zaa.att.ne.jp> writes:
>  But when I try to stop DB with "pg_ctl -w stop", it returns an error.
>  Error is "Waiting for postmaster shutting down.....pg_ctl: postmaster does not shut down"

Do you have active clients?

The default behavior of pg_ctl stop is to prevent new client connections
but not to shut down the database until the last old client disconnects.
If you want a more forceful approach to shutting down, read the man
page...

            regards, tom lane

Re: pg_ctl stop returns error

From
Murakami
Date:
Inoue san , Mr.Lane thanks for your quick reply.

I checked manual already.
My DB is just for a test and I don't see any clients working...
Or maybe some clients are working but I can't find them.

I see 7 postmaster process is running at my PC now.
Does it mean that I have 7 DB host process running?
I started DB with "postmaster -S -i ". So it means that I started DB with smart mode, right?

Any further suggestion?

Murakami

Hiroshi>
Hiroshi> See pg_ctl manual.
Hiroshi> Don't you shut down the postmaster in smart mode ?
Hiroshi> If some clients are running, they must be finished before
Hiroshi> calling pg_ctl in smart mode.
Hiroshi>
Hiroshi> regards,
Hiroshi> Hiroshi Inoue
Hiroshi>

Re: pg_ctl stop returns error

From
"Richard Huxton"
Date:
From: "Murakami" <exit@zaa.att.ne.jp>

> Inoue san , Mr.Lane thanks for your quick reply.
>
> I checked manual already.
> My DB is just for a test and I don't see any clients working...
> Or maybe some clients are working but I can't find them.

You've not been accessing PG via apache with persistent connections have
you? That'll tend to keep backends running even when not in use. Restart
apache and see if they go away.

> I see 7 postmaster process is running at my PC now.
> Does it mean that I have 7 DB host process running?

Yep - and you should be able to see the user accessing them too.

> I started DB with "postmaster -S -i ". So it means that I started DB with
smart mode, right?

According to "man postmaster" -S = silent (discard logging)

HTH

- Richard Huxton