Re: BUG #18677: numeric values in arrays are stored incorrectly

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #18677: numeric values in arrays are stored incorrectly
Дата
Msg-id CAApHDvrLw6GYq51=84SrstTwT0MzCfy5-eOdiFv+U-QL=6pQJA@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #18677: numeric values in arrays are stored incorrectly  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Tue, 29 Oct 2024 at 22:01, PG Bug reporting form
<noreply@postgresql.org> wrote:
> SELECT
>         jsonb_path_query('605814335005781813025241542787157911726959411820757128006101511735853521072'::JSONB,
> '$.number()') AS jsonb_path_value,  -- Works.
>         ARRAY['605814335005781813025241542787157911726959411820757128006101511735853521072']::NUMERIC[]
> as direct_numeric_array_outer,  -- Inaccurate.
>         ARRAY['605814335005781813025241542787157911726959411820757128006101511735853521072'::NUMERIC]
> as direct_numeric_array_inner,  -- Inaccurate.
>         '605814335005781813025241542787157911726959411820757128006101511735853521072'::NUMERIC
> as direct_numeric;  -- Works.
>
> {
>                 "jsonb_path_value" :
> "605814335005781813025241542787157911726959411820757128006101511735853521072",
>                 "direct_numeric_array_outer" :
> "{605,814,335,005,781,800,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000}",
>                 "direct_numeric_array_inner" :
> "{605,814,335,005,781,800,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000}",
>                 "direct_numeric" :
> 605814335005781813025241542787157911726959411820757128006101511735853521072
> }
>
> Is it not possible to store these values in an array accurately?

Which client are you using here? The thousands separator isn't
something we add to the numeric output, so something else must be
doing that. I suspect whatever third-party client you're using is
what's causing the problem.

Do you have any issues with psql?

David



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