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

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: marcel(at)vybenetwork(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18677: numeric values in arrays are stored incorrectly
Date: 2024-10-29 12:22:26
Message-ID: CAApHDvrLw6GYq51=84SrstTwT0MzCfy5-eOdiFv+U-QL=6pQJA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, 29 Oct 2024 at 22:01, PG Bug reporting form
<noreply(at)postgresql(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Maciej Jaros 2024-10-29 12:26:09 Re: BUG #18675: Postgres is not realasing memory causing OOM
Previous Message Michael Paquier 2024-10-29 07:48:46 Re: BUG #18146: Rows reappearing in Tables after Auto-Vacuum Failure in PostgreSQL on Windows