Re: BUG #13636: psql numericlocale adds comma where it ought not - Mailing list pgsql-bugs

From Thomas Munro
Subject Re: BUG #13636: psql numericlocale adds comma where it ought not
Date
Msg-id CAEepm=0x_-CpXc2VctwvKBn2eJ-HK04eZWFG1tAwr7d7kxJAyw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13636: psql numericlocale adds comma where it ought not  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #13636: psql numericlocale adds comma where it ought not  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Fri, Sep 25, 2015 at 2:19 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
>> On Fri, Sep 25, 2015 at 11:37 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Indeed.  It looks like the author of format_numeric_locale() never
>>> heard of e-format output.  There's some other pretty crummy code in
>>> there, but that's the core problem ...
>
>> Does this look reasonable?
>
> I thought it needed a rather more thoroughgoing revision: there is no need
> for it to assume so much about what is in the column, and good reason for
> it not to.  (For instance, I note that psql will try to apply this code to
> "money" columns, which may be a bad idea, but there can definitely be
> stuff in there that doesn't look like a regular number.)  It should muck
> with digits immediately following the sign, and nothing else.  There was
> some other useless inefficiency too.  I came up with the attached.
>
> I would have borrowed your regression test additions, except I'm afraid
> they will fail if the prevailing locale isn't C.

Oops, right.  (I suppose there could be a schedule of optional extra
tests that somehow run with C locale for psql, but perhaps not worth
setting up just for this.)

--
Thomas Munro
http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #13636: psql numericlocale adds comma where it ought not
Next
From: Tom Lane
Date:
Subject: Re: BUG #13636: psql numericlocale adds comma where it ought not