Re: JSONB order?

Поиск
Список
Период
Сортировка
От Christophe Pettus
Тема Re: JSONB order?
Дата
Msg-id 2871D4AD-7885-40BF-86A7-90E321C4E3AF@thebuild.com
обсуждение исходный текст
Ответ на Fwd: JSONB order?  (Tony Shelver <tshelver@gmail.com>)
Список pgsql-general

> On Nov 5, 2020, at 07:45, Tony Shelver <tshelver@gmail.com> wrote:
> 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
willbe a pain to order in some hard coded way. 

As Magnus noted, you can use JSON instead of JSONB.  JSON is basically a text blob with a syntax check wrapper around
it,so it will be order-stable once created.  (If you run it through a JSONB-expecting function, then the ordering may
changeagain.)  It's less efficient to operate on than JSONB, but that might be OK for your purposes. 

--
-- Christophe Pettus
   xof@thebuild.com




В списке pgsql-general по дате отправления:

Предыдущее
От: Ron
Дата:
Сообщение: Re: precautions/prerequisites to take for specific table
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: JSONB order?