Re: PL/Python result metadata - Mailing list pgsql-hackers

From Jan Urbański
Subject Re: PL/Python result metadata
Date
Msg-id 4F0E0C1C.9040504@wulczer.org
Whole thread Raw
In response to Re: PL/Python result metadata  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
On 11/01/12 22:52, Dimitri Fontaine wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
>> .colnames() returns a list of column names (strings)
>> .coltypes() returns a list of type OIDs (integers)
>>
>> I just made that up because there is no guidance in the other standard
>> PLs for this sort of thing, AFAICT.
> 
> What about having the same or comparable API as in psycopg or DB API
> 
>   http://initd.org/psycopg/docs/cursor.html
> 
> You could expose a py.description structure?

+1 for providing a read-only result.description. Not sure if it's worth
it to follow DB-API there, but maybe yes. Perhaps we could have a
result.description_ex information that's PG-specific or just not present
in PEP 249, like the typmod, collation and so on.

J


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: 16-bit page checksums for 9.2
Next
From: Josh Berkus
Date:
Subject: Re: [WIP] Double-write with Fast Checksums