Re: thousands comma numeric formatting in psql

Поиск
Список
Период
Сортировка
От Eugen Nedelcu
Тема Re: thousands comma numeric formatting in psql
Дата
Msg-id 20050718081459.GA385@sifolt.ro
обсуждение исходный текст
Ответ на Re: thousands comma numeric formatting in psql  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: thousands comma numeric formatting in psql
Список pgsql-patches
In function format_numericsep() you have:

new_str = pg_local_malloc(len_numericseps(my_str) + 1),

instead of:

new_str = pg_local_malloc(len_with_numericsep(my_str) + 1)

Another bug is in function len_numericseps(). This apear for querys
like:

select NULL::numeric; or
select * from table_with_numeric_fields; where one of numeric fields
have null values;

For such values, len_numericseps returns -1, instead of 0.

Instead of:

if (int_len % groupdigits != 0)
    sep_len = int_len / groupdigits;
else
    sep_len = int_len / groupdigits - 1;

you must have:

if (int_len % groupdigits != 0 || int_len == 0)
    sep_len = int_len / groupdigits;
else
    sep_len = int_len / groupdigits - 1;

Best Regards,
Eugen

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PL/PGSQL: Dynamic Record Introspection
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Constraint Exclusion (Partitioning) - Initial Review