Re: [HACKERS] Proposal for JSONB functions for internal representation casting insted text-casting

2016-01-06 Thread Pavel Stehule
2016-01-06 19:52 GMT+01:00 Robert Haas : > On Sun, Jan 3, 2016 at 3:24 PM, Peter Krauss wrote: > > The usefulness of ->> operator is indisputable, but even with boolean > or > > numeric values, with good binary internal representation, it returns > JSONB > > value as text data type. > > > > The

Re: [HACKERS] Proposal for JSONB functions for internal representation casting insted text-casting

2016-01-06 Thread Robert Haas
On Sun, Jan 3, 2016 at 3:24 PM, Peter Krauss wrote: > The usefulness of ->> operator is indisputable, but even with boolean or > numeric values, with good binary internal representation, it returns JSONB > value as text data type. > > The simple (myJSONB->>'myField')::expectedType is not enough

[HACKERS] Proposal for JSONB functions for internal representation casting insted text-casting

2016-01-03 Thread Peter Krauss
The usefulness of ->> operator is indisputable, but even with boolean or numeric values, with good binary internal representation, it returns JSONB value as text data type. The simple *(myJSONB->>'myField')::expectedType* is not enough because: 1) there are no internal optimization, need two-s