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  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Список pgsql-hackers
On Wed, Dec 15, 2010 at 1:25 PM, Daniele Varrazzo
<daniele.varrazzo@gmail.com> 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
Дата:
Сообщение: Re: Segfault related to pg_authid when running initdb from git master
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Complier warnings on mingw gcc 4.5.0