Re: JSON query help

Поиск
Список
Период
Сортировка
От Gavin Henry
Тема Re: JSON query help
Дата
Msg-id CAA8_NKBwNeYmoAVHicePw9j_H+D2uewBXUHjqwQP4_TcqAjNfg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: JSON query help  (Gavin Henry <gavin.henry@gmail.com>)
Ответы Re: JSON query help  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
I think I'm pretty close:

SELECT
cost_details->'Accounting'->jsonb_object_keys(cost_details->'Accounting')->'BalanceUUID'
AS BalanceUUID,
cost_details->'Accounting'->jsonb_object_keys(cost_details->'Accounting')->'Units'
AS Cost
FROM cdrs
WHERE cost > 0
AND cost_details->'AccountSummary'->'BalanceSummaries' @>
'[{"ID":"B_MONETARY_POSTPAID"}]'
AND cost_details->'AccountSummary'->'BalanceSummaries' @>
jsonb_build_object('UUID'::text,
cost_details->'Accounting'->jsonb_object_keys(cost_details->'Accounting')->'BalanceUUID')::jsonb
LIMIT 1;

ERROR:  function jsonb_build_object(text, jsonb) does not exist
LINE 1: ..._details->'AccountSummary'->'BalanceSummaries' @> jsonb_buil...
                                                             ^
HINT:  No function matches the given name and argument types. You
might need to add explicit type casts.



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

Предыдущее
От: Gavin Henry
Дата:
Сообщение: Re: JSON query help
Следующее
От: Tom Lane
Дата:
Сообщение: Re: JSON query help