Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Cc: Mark Llewellyn <mark_llewellyn(at)adp(dot)com>, pgsql-hackers(at)postgresql(dot)org, Sujeet Rajguru <sujeet(dot)rajguru(at)enterprisedb(dot)com>
Subject: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Date: 2010-09-24 13:23:32
Message-ID: AANLkTinqm4cY_e6C5cYh9Uf7gzX_-Vy475Z3ZO6_PKkr@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Fri, Sep 17, 2010 at 05:51, Ashesh Vashi
<ashesh(dot)vashi(at)enterprisedb(dot)com> wrote:
> Hi Mark,
>
> On of my college (Sujeet) has found a way to reproduce the same behaviour.
> 1. Installed PG 9.0 on Win XP SP3
> 2. Stop the Postgresql-9.0 service from service manager console
> 3. Create pgpass.conf in postgres (service account) user's profile with an
> incorrect password deliberately.
> (Refer: http://www.postgresql.org/docs/8.4/interactive/libpq-pgpass.html)
> 4. Now start the postgresql-9.0 service, it will return an error and the
> status
>    shows stopped
> 5. However i could connect to the psql shell and get the prompt which means
>     the server is running.

I took a quick look at the code, and from what I can tell this is
because PQconnectionNeedsPassword() always returns false if a
pgpass.conf has been used. There is no handling the case where pgpass
is used, but has an incorrect password.

Does anybody recall the specific reason for this? Do we need a way for
pg_ctl to figure this out, or do we need to change it in
PQconnecitonNeedsPassword()?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-09-24 14:04:55 Re: Re: [BUGS] BUG #5650: Postgres service showing as stopped when in fact it is running
Previous Message Robert Haas 2010-09-24 12:56:22 Re: installer problems

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-09-24 13:41:14 Re: pg_comments
Previous Message Dmitriy Igrishin 2010-09-24 13:13:45 Large objects.