Re: BUG #19110: the order of elements in a json object in database is different then the order of elements - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #19110: the order of elements in a json object in database is different then the order of elements
Date
Msg-id 2183808.1762874163@sss.pgh.pa.us
Whole thread Raw
In response to BUG #19110: the order of elements in a json object in database is different then the order of elements  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> This hash map is stored as a json object under a column defined as a json
> column (and not jsonb)
> what we are noticing is that when we send the relevant object from our
> application to postgres and fetch it back (using update and select queries
> respectivally) , the order of elemenet in the hash map is changing which
> causes a problem in our end.

The only way this could possibly be happening on the Postgres server
side is if the value is being cast to jsonb on its way to the table.
I'd check issues like how the prepared statement's parameter is
declared.

If you are going through JDBC or another client-side stack, it's
possible that that is substituting jsonb for json in the command
issued to the server.  You might need to pretend that the parameter
is plain text to avoid that.

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19110: the order of elements in a json object in database is different then the order of elements
Next
From: Vik Fearing
Date:
Subject: Re: BUG #19106: Potential regression with CTE materialization planning in Postgres 18