Re: [HACKERS] Fix number skipping in to_number

2018-10-22 Thread Ioseph Kim
Hi. I'm checking release note for version 11. in that. |"L| and |TH| now only consume characters that are not digits, positive/negative signs, decimal points, or commas." postgres@postgres=# select to_number('1234', '+');  to_number ---    234 Is this right? Regards, ios

Re: Fix number skipping in to_number

2017-11-17 Thread Tom Lane
I wrote: > That leads me to the attached patch. There is more that could be done > here --- in particular, I'd like to see the character-not-byte-count > rule extended to literal text. But that seems like fit material for > a different patch. Attached is a patch that makes formatting.c more mult

Re: Fix number skipping in to_number

2017-11-17 Thread Tom Lane
I wrote: > That leads me to the attached patch. There is more that could be done > here --- in particular, I'd like to see the character-not-byte-count > rule extended to literal text. But that seems like fit material for > a different patch. Hearing no further comments, I pushed that patch.

Re: Fix number skipping in to_number

2017-11-15 Thread Tom Lane
I wrote: > Oliver Ford writes: >> On Monday, 13 November 2017, Tom Lane wrote: >>> I don't follow your concern? If "$" is not the correct currency >>> symbol for the locale, we shouldn't accept it as a match to an L format. >>> Your patch is tightening what we will accept as a match to a G forma

Re: Fix number skipping in to_number

2017-11-13 Thread Tom Lane
Oliver Ford writes: > On Monday, 13 November 2017, Tom Lane wrote: >> I don't follow your concern? If "$" is not the correct currency >> symbol for the locale, we shouldn't accept it as a match to an L format. >> Your patch is tightening what we will accept as a match to a G format, >> so I don'

Re: Fix number skipping in to_number

2017-11-13 Thread Oliver Ford
On Monday, 13 November 2017, Tom Lane wrote: > Oliver Ford > writes: > > On Sun, Nov 12, 2017 at 7:00 PM, Tom Lane > wrote: > >> * Don't we need to fix the NUM_L (currency symbol) case in the > >> same manner? (The NUM_D and NUM_S cases are handled in > >> NUM_numpart_from_char and seem ok at a

Re: [HACKERS] Fix number skipping in to_number

2017-11-13 Thread Tom Lane
Oliver Ford writes: > On Sun, Nov 12, 2017 at 7:00 PM, Tom Lane wrote: >> * Don't we need to fix the NUM_L (currency symbol) case in the >> same manner? (The NUM_D and NUM_S cases are handled in >> NUM_numpart_from_char and seem ok at a quick glance.) > Yes you get the same skipping if you do:

Re: [HACKERS] Fix number skipping in to_number

2017-11-13 Thread Oliver Ford
On Sun, Nov 12, 2017 at 7:00 PM, Tom Lane wrote: > Oliver Ford writes: >> [ 0001-apply-number-v3.patch ] > > I looked at this patch briefly and have a couple of comments: > > * It seems entirely wrong to be matching to L_thousands_sep in the > NUM_COMMA case; that format code is by definition not