retrieve subset of a jsonb object with a list of keys

Поиск
Список
Период
Сортировка
Искать
От
Tom Smith
Тема
retrieve subset of a jsonb object with a list of keys
Дата
Msg-id
CAKwSVFHk+m16ouvymp1mMPq4LU1hpdFhJ-=05nU3kumdPxx4-w@mail.gmail.com
Список
Дерево обсуждения
retrieve subset of a jsonb object with a list of keys Tom Smith <tomsmith1989sk@gmail.com>
Re: retrieve subset of a jsonb object with a list of keys Chris Mair <chris@1006.org>
Re: retrieve subset of a jsonb object with a list of keys Tom Smith <tomsmith1989sk@gmail.com>
Hi:

I have a jsonb columne with json object like belo
{"a": 1, "b":2, "c":3}

I'd like to get subset of the object with key list ["a","c"]
so it retruns json object of

{"a": 1,  "c":3}

something like

select '{"a": 1, "b":2, "c":3}'::jsob ->'["a","c"]'

what would be the most efficient (and simplest if possible) to get the subset with the key list?

Thanks
В списке pgsql-general по дате отправления
От: Michael H
Дата:
От: Chris Mair
Дата:
FAQ