Re: [PATCHES] thousands comma numeric formatting in psql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Eugen Nedelcu <eugen(at)sifolt(dot)ro>
Subject: Re: [PATCHES] thousands comma numeric formatting in psql
Date: 2005-07-12 16:33:35
Message-ID: 20067.1121186015@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Ah, I see this now in our code:

> CurrentLocaleConv.decimal_point = strdup(extlconv->decimal_point);
> CurrentLocaleConv.grouping = strdup(extlconv->grouping);
> CurrentLocaleConv.thousands_sep = strdup(extlconv->thousands_sep);

> Is this what we should be using?

That's what I'd think. We know that localeconv() is portable --- that
code has been there for years.

> Does psql use any of this now (I think no).

A quick grep shows this is the only call of localeconv() in our code.

Note: it occurs to me that those strdup's could fail in low-memory
conditions, and we're not checking. Probably the routine should
be rewritten to palloc into TopMemoryContext. Will see about it.

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2005-07-12 16:50:58 Re: [PATCHES] thousands comma numeric formatting in psql
Previous Message Tom Lane 2005-07-12 16:20:09 Re: CONCURRENT INDEXing again (was: Must be owner to truncate?)