Best way to populate nested composite type from JSON`

Поиск
Список
Период
Сортировка
От Chris Travers
Тема Best way to populate nested composite type from JSON`
Дата
Msg-id CAKt_ZfuqXT4XsMFnnziE9WhMGxba9d+rJa5quO6_p3Jewon9Tg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Best way to populate nested composite type from JSON`  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
Hi everyone;

I have been starting to experiment with the JSON accessors in 9.3.  I immediately found that my preferred use, populating nested composite types, is not supported.  Also of course one cannot manipulate JSON nodes, which leads to the question of how best to do this.  I had some ideas:

1.  A custom C function utilizing the internal functions PostgreSQL offers for JSON parsing (probably looking at the json_populate_record() as a base)

2.  Utilizing hstore as an intermediate representation along with json_each()

3.  Perhaps using something like pl/perlu or the like.

This leads to a few questions, including whether it would be worthwhile looking at trying to handle nested types in json_populate_record() and if anyone is working on such a thing currently.

--
Best Wishes,
Chris Travers

Efficito:  Hosted Accounting and ERP.  Robust and Flexible.  No vendor lock-in.

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

Предыдущее
От: bricklen
Дата:
Сообщение: Re: fsync and wal_sync_method
Следующее
От: Chris Travers
Дата:
Сообщение: Re: Re: PG 9.3 complains about specified more than once ??? Those views worked in PG 9.1 + 9.2