Re: cant connect to the database, even after doing start

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: cant connect to the database, even after doing start
Date: 2006-07-13 15:57:57
Message-ID: 1152806277.14241.69.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2006-07-13 at 01:20, surabhi.ahuja wrote:
> Hi all,
> i have a script to stop and start postmaster
>
> However i have noticed this many a time sdnow. I stop postmaster using
> that script
> and then start using a script.
>
> However if i try to do psql <dbname>, it gives me an error saying that
> the postmaster is not up.
>
> Why is it that the postmaster went down on its own, even though i had
> done a srart after stop.

How are you stopping the database? Let me guess that it's "pg_ctl -m
immediate stop".

pg_ctl --help tells us:

Shutdown modes are:
smart quit after all clients have disconnected
fast quit directly, with proper shutdown
immediate quit without complete shutdown; will lead to recovery on
restart

Basically, -m immediate does a kill -9 on all the postgresql processes.
It's an inch away from pulling the plug, except that lying hardware
still gets to flush its caches.

So, if you're stopping pgsql that way, then when it starts up, it does
so in recovery mode, and it can't allow connections until recovery is
finished.

If you're stopping it some other way though, then things might be going
wrong in some other way.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2006-07-13 15:59:59 Re: db clustering?
Previous Message Scott Marlowe 2006-07-13 15:53:05 Re: SQL Standards Compliance With Case