Re: JSONB order?

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Tony Shelver <tshelver(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: JSONB order?
Date: 2020-11-05 15:40:00
Message-ID: 85B65AB1-BD99-4F15-9B33-86F2B00EA106@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Nov 5, 2020, at 07:34, Tony Shelver <tshelver(at)gmail(dot)com> wrote:
> But... seen above, the order gets mixed up.
>
> Any ideas?

JSON objects, like Python dicts, are not automatically ordered by key. Once you move from the column space to the JSON object space, you can't rely on the object keys being in a consistent order.

You'll want to have a step when ingesting the JSON object into a report that lines up the key values appropriately with the right presentation in the report.
--
-- Christophe Pettus
xof(at)thebuild(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2020-11-05 15:41:22 Re: JSONB order?
Previous Message Tony Shelver 2020-11-05 15:34:51 JSONB order?