Re: [BUGS] surprising to_timestamp behavior - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [BUGS] surprising to_timestamp behavior
Date
Msg-id 32524.1390244013@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] surprising to_timestamp behavior  (Jeevan Chalke <jeevan.chalke@enterprisedb.com>)
List pgsql-hackers
Jeevan Chalke <jeevan.chalke@enterprisedb.com> writes:
>> I went to review this, and found that there's not actually a patch
>> attached ...

> Attached. Sorry for that.

This looks good to me except for one thing: if the upcoming node is a
DCH_FX action (ie, turn on fx_mode), I don't think we want to skip
whitespace.  The original coding had that bug too, but it was only
exposed if the FX prefix was immediately preceded by whitespace in
the format.

It's a bit hard to think of useful cases where this would make a
difference, because it turns out that from_char_parse_int contains
an internal skip-whitespace action that's applied regardless of FX
mode, so it really only matters for non-integer field types.  I
kinda think that maybe now we should remove that extra skip, or at
least count the skipped whitespace against the field width, but
did not experiment to see what the results would be.

Committed with that change and some cosmetic adjustments.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Trigger information for auto_explain.
Next
From: Alvaro Herrera
Date:
Subject: Re: Trigger information for auto_explain.