Re: Slightly better testing for pg_ctl(1)'s -w...

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Sean Chittenden <chitt(at)speakeasy(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Slightly better testing for pg_ctl(1)'s -w...
Date: 2004-10-16 03:09:04
Message-ID: 200410160309.i9G394D03437@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Patch applied. Thanks.

I simplified your test and made the error message a #define that is now
used consistently in all places. Patch attached.

---------------------------------------------------------------------------

Sean Chittenden wrote:
> pg_ctl(1)'s -w option works well if the default user can automatically
> authenticate without any user intervention. The attached patch checks
> the error message to see if it's asking for a password. The theory
> being that if it's asking for a password, the backend is up. I'm not
> entirely happy with the fact that I'm dependent on the error message
> text, but I couldn't easily figure out a better way to test this via
> libpq(3), so I'm not too unhappy... it's just not elegant. This patch
> does not encompass all possible scenarios for the backend being up, but
> CONNECTION_BAD being set in libpq(3). Regardless, it's a start and
> hopefully someone can apply this. I also cleaned up a small memory
> leak when a connection is bad (PGconn not being free(3)'ed). -sc
>
> % pg_ctl -w start && psql
> waiting for postmaster to start....done
> postmaster started
> test=>
>

[ Attachment, skipping... ]

>
>
> --
> Sean Chittenden
>

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 7.2 KB

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-10-16 03:23:22 Re: libpq.dll on win32
Previous Message Reini Urban 2004-10-16 01:01:55 Re: postgresql 8.0 with cygwin - success