Automatically parsing in-line composite types

Поиск
Список
Период
Сортировка
От Mitar
Тема Automatically parsing in-line composite types
Дата
Msg-id CAKLmikMrm778-eETLvVAd1W_u0R8TB+suAFO6jhMTmXQg3yhGg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Automatically parsing in-line composite types
Список pgsql-general
Hi!

I am trying to understand how could I automatically parse an in-line
composite type. By in-line composite type I mean a type corresponding
to ROW. For example, in the following query:

SELECT _id, body, (SELECT array_agg(ROW(comments._id, comments.body))
FROM comments WHERE comments.post_id=posts._id) AS comments FROM posts

It looks like I can figure out that "comments" is an array of records.
But then there is no way really to understand how to parse those
records? So what are types of fields in the record?

I start the parsing process by looking at types returned in
RowDescription message and then reading descriptions in pg_type table.

Is there some other way to get full typing information of the result I
am assuming is available to PostreSQL internally?


Mitar

-- 
http://mitar.tnode.com/
https://twitter.com/mitar_m



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

Предыдущее
От: Ken Tanzer
Дата:
Сообщение: Re: PostgreSQL License
Следующее
От: Ron
Дата:
Сообщение: Re: PostgreSQL License