Re: JSONB order?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(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 16:16:37
Message-ID: CAKFQuwZgdzGeW1kkHnck0CYwuA6dKq26wqEhmHOrHR8wza8Pow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Nov 5, 2020 at 8:46 AM Tony Shelver <tshelver(at)gmail(dot)com> wrote:

>
>
> ---------- Forwarded message ---------
> From: Tony Shelver <tshelver(at)gmail(dot)com>
> Date: Thu, 5 Nov 2020 at 17:45
> Subject: Re: JSONB order?
> To: Christophe Pettus <xof(at)thebuild(dot)com>
>
>
> Thanks Christophe, that's what I thought.
> Just seemed weird that they were 'disordered' in exactly the same way
> every time.
>
> FYI, as of Python 3.7, dicts *are* ordered.
>
> The problem is that we are possibly going to have many versions of these
> forms with slightly differing keys, which will be a pain to order in some
> hard coded way.
>

The Google Sheet source document has column ordering. If that is what you
want to rely upon have your Python code capture that into an array and
attach that array to the json document as a separate
"field_headers_ordered" key (or something similar).

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2020-11-05 16:27:43 Re: JSONB order?
Previous Message Christophe Pettus 2020-11-05 16:12:56 Re: JSONB order?