Re: Why is JSONB field automatically cast as TEXT?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Why is JSONB field automatically cast as TEXT?
Дата
Msg-id CAKFQuwYRCjohY4j8VwzML2tTPZVanJ0yw_MFnpSKW55NS66RZA@mail.gmail.com
обсуждение исходный текст
Ответ на Why is JSONB field automatically cast as TEXT?  (Ben Uphoff <buphoff@villagemd.com>)
Список pgsql-general
On Monday, September 17, 2018, Ben Uphoff <buphoff@villagemd.com> wrote:

SELECT (((mytable.ajsonbcolumn -> ‘somedata’::text) -> ‘nested’::text) ->> ‘first_name’::text) AS fname FROM mytable

It’s casting the untyped literal constants (somedata, neated, first_name) to text because everything must be typed.  It is not casting the first or intermediate jsonb results to text.  The final output is text because of the ->> operator.

:: binds more tightly than the other operators.

Jsonb->('somedata'::text)

David J.

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

Предыдущее
От: Ben Uphoff
Дата:
Сообщение: Why is JSONB field automatically cast as TEXT?
Следующее
От: Seamus Abshere
Дата:
Сообщение: Too many BitmapAnds in the wild