Re: Extracting JSON data into columns
От | David G. Johnston |
---|---|
Тема | Re: Extracting JSON data into columns |
Дата | |
Msg-id | CAKFQuwYquKPjjdVsprxNGqUVSHCFj9M8V6tbLmRbyp+5VbYfsQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Extracting JSON data into columns ("Ferrell, Denise SDC" <denise.ferrell@sdc-world.com>) |
Список | pgsql-admin |
Not tested...
WITH json_data (jd) AS (
VALUES ('{"key":"value", "key2":"value2"}'::json)
)
SELECT jd->>'key' AS col1, jd->>'key2' AS col2
FROM json_data
Also useful is the:
json_populate_record(...)
function.
Try them and ask specific questions if you still have them. Incorporating a self-contained example like mine lowers the bar for others to provide useful help.
Also consider upgrading to 9.5 if you expect to do heavy JSON work - features for this type have been being added at a good clip these past couple of years.
David J.
В списке pgsql-admin по дате отправления: