Re: JSON[B] arrays are second-class citizens

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: JSON[B] arrays are second-class citizens
Дата
Msg-id CAKFQuwbziEotpkCHunBb1P=mB8Cv7s3aFfBr0nQr-PFedoOJyg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: JSON[B] arrays are second-class citizens  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
On Wed, Jun 1, 2016 at 11:55 AM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
On 5/31/16 7:04 PM, Peter van Hardenberg wrote:
The idea of converting a JSONB array to a PG array is appealing and
would potentially be more general-purpose than adding a new unnest. I'm
not sure how feasible either suggestion is.

The one part I think is missing right now is unnest allows you to 'stitch' or 'zip' multiple arrays together into a single recordset via unnest(array1, array2, ...). Presumably that could be added to the json equivalents.

You can just use "ROWS FROM" to get the same result.

"""
The special table function UNNEST may be called with any number of array parameters, and it returns a corresponding number of columns, as if UNNEST (Section 9.18) had been called on each parameter separately and combined using the ROWS FROM construct.
​"""

​Yes, the unnest form can be used within the target-list but that argument is not going to get you very far as that use of SRF is greatly frowned upon now that we have LATERAL.

David J.

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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Floating point comparison inconsistencies of the geometric types
Следующее
От: Andreas Karlsson
Дата:
Сообщение: Re: Parallel safety tagging of extension functions