Search Postgresql Archives

Re: Why is JSONB field automatically cast as TEXT?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, September 17, 2018, Ben Uphoff <buphoff@xxxxxxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux