Re: Error in from_char() for field 'D'? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Error in from_char() for field 'D'?
Date
Msg-id 27327.1164407031@sss.pgh.pa.us
Whole thread Raw
In response to Error in from_char() for field 'D'?  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: Error in from_char() for field 'D'?  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
"Brendan Jurd" <direvus@gmail.com> writes:
> However, in from_char(), the reverse is not true.  Looking at the code
> snippet above, the digit is scanned straight into tmfc->d unaltered
> (this value is later copied directly to tm->tm_wday circa line 3394).
> Unless I'm missing something, when converting to text, 'D' yields 1-7,
> but when converting back from text, 'D' expects 0-6.

Although this does look like a bug, I'm not sure it matters, because
AFAICS there is no code path that will look at the value of tm_wday
while constructing a timestamp value from a struct tm.  I'm inclined
not to risk messing with it just before RC1 unless a visible fault
can be demonstrated.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Andrew Dunstan"
Date:
Subject: Re: RC1 blocker issues
Next
From: Bruce Momjian
Date:
Subject: Re: [CORE] RC1 blocker issues