pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14001: pg_ctl error output empty/faulty
4+ messages / 3 participants
[nested] [flat]

* BUG #14001: pg_ctl error output empty/faulty
@ 2016-03-05 12:00 doublem09@googlemail.com
  2016-03-07 10:48 ` Re: BUG #14001: pg_ctl error output empty/faulty Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: doublem09@googlemail.com @ 2016-03-05 12:00 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14001
Logged by:          Manuel Mathar
Email address:      doublem09@googlemail.com
PostgreSQL version: 9.5.1
Operating system:   Windows 7 (Enterprise), Windows 10
Description:        

Error messages from pg_ctl can't be piped. Tested for 9.5.1, 9.5.0 and 9.3.5
on Windows 7 and 10.

For a simple "pg_ctl status" an error message concerning the missing "-D"
parameter should be expected. But when reading the standard error with
another program (tested with Qt's QProcess readAllStandardError) or piping
it into a file "pg_ctl status 2> out.txt" the result is empty.

Under Windows 10 error messages don't appear even in the command line (no
problem for Windows 7 here).
E.g. typing "pg_ctl status" in a cmd shell yields no output at all.

After a brief test it seems this can be fixed by correcting the negation 
"if (!pgwin32_is_service())" to "if (pgwin32_is_service())" in pg_ctl.c
write_stderr(...).

Sorry if I misunderstood this or forgot important information. Feel free to
contact me if You have further questions.

Best regards,
Manuel Mathar


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #14001: pg_ctl error output empty/faulty
  2016-03-05 12:00 BUG #14001: pg_ctl error output empty/faulty doublem09@googlemail.com
@ 2016-03-07 10:48 ` Michael Paquier <michael.paquier@gmail.com>
  2016-03-07 15:41   ` Re: BUG #14001: pg_ctl error output empty/faulty Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Michael Paquier @ 2016-03-07 10:48 UTC (permalink / raw)
  To: doublem09@googlemail.com; +Cc: pgsql-bugs

On Sat, Mar 5, 2016 at 9:00 PM,  <doublem09@googlemail.com> wrote:
> Under Windows 10 error messages don't appear even in the command line (no
> problem for Windows 7 here).
> E.g. typing "pg_ctl status" in a cmd shell yields no output at all.
>
> After a brief test it seems this can be fixed by correcting the negation
> "if (!pgwin32_is_service())" to "if (pgwin32_is_service())" in pg_ctl.c
> write_stderr(...).

Indeed. I don't think that this oversight from a9676139 needs much comment...
inline patch 1: src/bin/pg_ctl/pg_ctl.c (+1/-1 lines) download inline-1.patch--- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -216,7 +216,7 @@ write_stderr(const char *fmt,...) * On Win32, we print to stderr if running on a console, or write to * eventlog if running as a service */ - if (!isatty(fileno(stderr))) /* Running as a service */ + if (!pgwin32_is_service()) /* Running as a service */ {
Could somebody switch this condition? We should not write to the event logs if this code is not run for a service. -- Michael -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs ^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: BUG #14001: pg_ctl error output empty/faulty
  2016-03-05 12:00 BUG #14001: pg_ctl error output empty/faulty doublem09@googlemail.com
  2016-03-07 10:48 ` Re: BUG #14001: pg_ctl error output empty/faulty Michael Paquier <michael.paquier@gmail.com>
@ 2016-03-07 15:41   ` Tom Lane <tgl@sss.pgh.pa.us>
  2016-03-07 22:05     ` Re: BUG #14001: pg_ctl error output empty/faulty Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2016-03-07 15:41 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: pgsql-bugs

Michael Paquier <michael.paquier@gmail.com> writes:
> On Sat, Mar 5, 2016 at 9:00 PM,  <doublem09@googlemail.com> wrote:
>> After a brief test it seems this can be fixed by correcting the negation
>> "if (!pgwin32_is_service())" to "if (pgwin32_is_service())" in pg_ctl.c
>> write_stderr(...).

> Indeed. I don't think that this oversight from a9676139 needs much comment...
> --- a/src/bin/pg_ctl/pg_ctl.c
> +++ b/src/bin/pg_ctl/pg_ctl.c
> @@ -216,7 +216,7 @@ write_stderr(const char *fmt,...)
>      * On Win32, we print to stderr if running on a console, or write to
>      * eventlog if running as a service
>      */
> -   if (!isatty(fileno(stderr)))    /* Running as a service */
> +   if (!pgwin32_is_service())  /* Running as a service */
>     {
> Could somebody switch this condition? We should not write to the event
> logs if this code is not run for a service.

Done.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #14001: pg_ctl error output empty/faulty
  2016-03-05 12:00 BUG #14001: pg_ctl error output empty/faulty doublem09@googlemail.com
  2016-03-07 10:48 ` Re: BUG #14001: pg_ctl error output empty/faulty Michael Paquier <michael.paquier@gmail.com>
  2016-03-07 15:41   ` Re: BUG #14001: pg_ctl error output empty/faulty Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-03-07 22:05     ` Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Michael Paquier @ 2016-03-07 22:05 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs

On Tue, Mar 8, 2016 at 12:41 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Michael Paquier <michael.paquier@gmail.com> writes:
>> On Sat, Mar 5, 2016 at 9:00 PM,  <doublem09@googlemail.com> wrote:
>>> After a brief test it seems this can be fixed by correcting the negation
>>> "if (!pgwin32_is_service())" to "if (pgwin32_is_service())" in pg_ctl.c
>>> write_stderr(...).
>
>> Indeed. I don't think that this oversight from a9676139 needs much comment...
>> --- a/src/bin/pg_ctl/pg_ctl.c
>> +++ b/src/bin/pg_ctl/pg_ctl.c
>> @@ -216,7 +216,7 @@ write_stderr(const char *fmt,...)
>>      * On Win32, we print to stderr if running on a console, or write to
>>      * eventlog if running as a service
>>      */
>> -   if (!isatty(fileno(stderr)))    /* Running as a service */
>> +   if (!pgwin32_is_service())  /* Running as a service */
>>     {
>> Could somebody switch this condition? We should not write to the event
>> logs if this code is not run for a service.
>
> Done.

Thanks..
-- 
Michael


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-03-07 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-03-05 12:00 BUG #14001: pg_ctl error output empty/faulty doublem09@googlemail.com
2016-03-07 10:48 ` Michael Paquier <michael.paquier@gmail.com>
2016-03-07 15:41   ` Tom Lane <tgl@sss.pgh.pa.us>
2016-03-07 22:05     ` Michael Paquier <michael.paquier@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox