BUG #3462: pg_ctl error output cannot be redirected

Поиск
Список
Период
Сортировка
От Eugene Gershnik
Тема BUG #3462: pg_ctl error output cannot be redirected
Дата
Msg-id 200707180319.l6I3JKgE024141@wwwmaster.postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      3462
Logged by:          Eugene Gershnik
Email address:      gershnik@hotmail.com
PostgreSQL version: 8.2.4
Operating system:   Windows
Description:        pg_ctl error output cannot be redirected
Details:

On Windows an attempt to do

pg_ctl ... > file.txt 2>&1

where ... stands for any parameters that make pg_ctl fail sends stderr
output to event log rather than file.txt.
This is caused by the following incorrect test in pg_ctl.c in function
write_stderr(const char *fmt,...)

if (!isatty(fileno(stderr)))
...

This test will succeed for anything other than console being stderr. It is
obviously incorrect since when the output is redirected to a file or pipe
you also want to print it rather than to send it to event log. What you need
to test is whether GetStdHandle returns an invalid handle.

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #3431: age() gets the days wrong
Следующее
От: "Alex"
Дата:
Сообщение: BUG #3467: Sum strange behaviour