Bruce Momjian <pgman@candle.pha.pa.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