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

From Peter Eisentraut
Subject Re: PL/Python result metadata
Date
Msg-id 1326739591.29466.4.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: PL/Python result metadata  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: PL/Python result metadata  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
On ons, 2012-01-11 at 22:52 +0100, 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?

I deliberately chose not to do that, because the PL/Python API is
intentionally totally different from the standard DB-API, and mixing in
some semi-conforming look-alike would be quite confusing from both ends.
I think we should stick with the PL/Python API being a small layer on
top of SPI, and let the likes of plpydbapi handle the rest.




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: PL/Python result metadata
Next
From: Magnus Hagander
Date:
Subject: Re: pgstat documentation tables