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

Поиск
Список
Период
Сортировка
От Sean Chittenden
Тема Slightly better testing for pg_ctl(1)'s -w...
Дата
Msg-id 05D5F896-1A85-11D9-BF1B-000A95C705DC@speakeasy.net
обсуждение исходный текст
Ответы Re: Slightly better testing for pg_ctl(1)'s -w...  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Slightly better testing for pg_ctl(1)'s -w...  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
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=>



--
Sean Chittenden


Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: cast pid_t to int when using *printf
Следующее
От: Sean Chittenden
Дата:
Сообщение: Casting INT4 to BOOL...