Re: BUG #18677: numeric values in arrays are stored incorrectly - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #18677: numeric values in arrays are stored incorrectly
Date
Msg-id CAApHDvrLw6GYq51=84SrstTwT0MzCfy5-eOdiFv+U-QL=6pQJA@mail.gmail.com
Whole thread Raw
In response to BUG #18677: numeric values in arrays are stored incorrectly  (PG Bug reporting form <noreply@postgresql.org>)
List 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 by date:

Previous
From: Muhammad Waqas
Date:
Subject: Re: BUG #18676: Execute function while selecting from table with partial index using this function.
Next
From: Maciej Jaros
Date:
Subject: Re: BUG #18675: Postgres is not realasing memory causing OOM