Re: [HACKERS] getting composite types info from libpq

2010-12-16 Thread Merlin Moncure
On Thu, Dec 16, 2010 at 5:03 AM, Florian Pflug wrote: > On Dec16, 2010, at 02:51 , Daniele Varrazzo wrote: >> 1. do I get enough info in the PGresult to inspect anonymous composite types? > You just get the composite value, as you discovered. In text mode, that means > only the composite string va

Re: [HACKERS] getting composite types info from libpq

2010-12-16 Thread Florian Pflug
On Dec16, 2010, at 02:51 , Daniele Varrazzo wrote: > 1. do I get enough info in the PGresult to inspect anonymous composite types? You just get the composite value, as you discovered. In text mode, that means only the composite string value, which contains no information about the individual field'

Re: [HACKERS] getting composite types info from libpq

2010-12-15 Thread Daniele Varrazzo
On Wed, Dec 15, 2010 at 6:56 PM, Merlin Moncure wrote: > 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)") >>

Re: [HACKERS] getting composite types info from libpq

2010-12-15 Thread Merlin Moncure
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, No

[HACKERS] getting composite types info from libpq

2010-12-15 Thread Daniele Varrazzo
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;