Re: getting composite types info from libpq

Поиск
Список
Период
Сортировка
Искать
От
Merlin Moncure
Тема
Re: getting composite types info from libpq
Дата
Msg-id
AANLkTi=_CaRWrJRriOrL2ibg9qQAKiRtA1YToQPAzwZU@mail.gmail.com
Ответ на
Список
Дерево обсуждения
getting composite types info from libpq Daniele Varrazzo <daniele.varrazzo@gmail.com>
Re: getting composite types info from libpq Merlin Moncure <mmoncure@gmail.com>
Re: getting composite types info from libpq Daniele Varrazzo <daniele.varrazzo@gmail.com>
Re: getting composite types info from libpq Florian Pflug <fgp@phlo.org>
Re: getting composite types info from libpq Merlin Moncure <mmoncure@gmail.com>
On Wed, Dec 15, 2010 at 1:25 PM, Daniele Varrazzo
 wrote:
> Hello,
>
> when a query returns a composite type, the libpq PQftype() function
> reports the oid of the "record" type. In psycopg:
>
>    >>> cur.execute("select (1,2)")
>    >>> cur.description
>    (('row', 2249, None, -1, None, None, None),)
>
>    test=# select typname from pg_type where oid = 2249;
>     typname
>    ---------
>     record
>
> Is there a way to recursively retrieve the types for the record components?

not without talking to the server, unless you had previously pulled
pg_attribute data.

select * from pg_attribute where attrelid = 2249;

This question is more appropriate for -general, but what are you trying to do?

merlin

В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
От: Andrew Dunstan
Дата:
FAQ