Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Win32 WEXITSTATUS too

From: "Takayuki Tsunakawa" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Magnus Hagander" <magnus(at)hagander(dot)net>, "ITAGAKI Takahiro" <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, "PostgreSQL-patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Win32 WEXITSTATUS too
Date: 2007-01-23 01:58:17
Message-ID: 01e901c73e91$f3370dc0$19527c0a@OPERAO (view raw or flat)
Thread:
Lists: pgsql-patches
> Well, I am thinking of cases where we the error can help the user
> diagnose the problem.  I have found a way to print descriptions with
> FormatMessage(), and the codes without descriptions will just print
as
> hex.

I also think this is correct.  Like errno and strerror() combination
on UNIX, descriptions obtained from FormatMessage() should be
displayed with error codes from GetLastError().  I thought Bruce-san
is trying to display descriptions (or a URL to them) for the
"exception" codes, not "error" codes.  Descriptions for exception
codes can't be obtained with FormatMessage, can they?


----- Original Message ----- 
From: "Bruce Momjian" <bruce(at)momjian(dot)us>
To: "Takayuki Tsunakawa" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>; "Alvaro Herrera"
<alvherre(at)commandprompt(dot)com>; "Magnus Hagander" <magnus(at)hagander(dot)net>;
"ITAGAKI Takahiro" <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>;
"PostgreSQL-patches" <pgsql-patches(at)postgresql(dot)org>
Sent: Tuesday, January 23, 2007 10:37 AM
Subject: Re: [pgsql-patches] [HACKERS] Win32 WEXITSTATUS too


> Takayuki Tsunakawa wrote:
>> From: "Bruce Momjian" <bruce(at)momjian(dot)us>
>> > Tom Lane wrote:
>> >> Basically this whole idea is misconceived.  Just print the
number
>> and
>> >> have done.
>> >
>> > And how do people interpret that number?
>>
>> I understand that "people" Bruce-san is saying means PostgreSQL
>> developers, not ordinary users.
>> When ordinary users encounter an Win32 exception, what they can do
is
>> to report the message and the description of phenomenon to
PostgreSQL
>> developers.  What can they do when they see the descriptive text of
an
>> exception code, such as "Access violation" for 0xC0000005?  An
>> exception means a bug of PostgreSQL.  Win32 exceptions are
different
>> from errno on UNIX (counterpart of which is Win32 error code.)  Can
>> they avoid the exception by changing PostgreSQL settings?  If
luckly
>> so in one case, can they think of the treatment from the message?
>>
>> If "people" means PostgreSQL developers, the descriptive text is
not
>> necessary either.  I think the developers who try to solve the bug
>> know where to refer to interpret the exception code.
>>
>> My opinion is the same as Tom-san's.
>
> Well, I am thinking of cases where we the error can help the user
> diagnose the problem.  I have found a way to print descriptions with
> FormatMessage(), and the codes without descriptions will just print
as
> hex.
>
> -- 
>  Bruce Momjian   bruce(at)momjian(dot)us
>  EnterpriseDB    http://www.enterprisedb.com
>
>  + If your life is a hard drive, Christ can be your backup. +
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 6: explain analyze is your friend
>



In response to

pgsql-patches by date

Next:From: Takayuki TsunakawaDate: 2007-01-23 02:55:57
Subject: Re: [HACKERS] Win32 WEXITSTATUS too
Previous:From: Bruce MomjianDate: 2007-01-23 01:46:44
Subject: Re: [HACKERS] Win32 WEXITSTATUS too

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group