Re: [PATCHES] thousands comma numeric formatting in psql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCHES] thousands comma numeric formatting in psql
Дата
Msg-id 20067.1121186015@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: CONCURRENT INDEXing again (was: Must be owner to truncate?)
Следующее
От: David Fetter
Дата:
Сообщение: Re: [PATCHES] thousands comma numeric formatting in psql