Re: PL/Python result metadata
Jan Urbański <wulczer@wulczer.org>
From: Jan Urbański <wulczer@wulczer.org>
To: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Cc: Peter Eisentraut <peter_e@gmx.net>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-01-11T22:24:28Z
Lists: 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