pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: tal.tabakman@foretellix.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19110: the order of elements in a json object in database is different then the order of elements
Date: Tue, 11 Nov 2025 10:16:03 -0500
Message-ID: <2183808.1762874163@sss.pgh.pa.us> (raw)
In-Reply-To: <19110-dffefa888c44b48f@postgresql.org>
References: <19110-dffefa888c44b48f@postgresql.org>

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





view thread (2+ messages)

Message-ID: <2183808.1762874163@sss.pgh.pa.us>
Permalink:  ../2183808.1762874163@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2183808.1762874163@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tal.tabakman@foretellix.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #19110: the order of elements in a json object in database is different then the order of elements
  In-Reply-To: <2183808.1762874163@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox