PL/Python result metadata

Поиск
Список
Период
Сортировка
Искать

PL/Python result metadata

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
There is currently no reliable way to retrieve from a result object in
PL/Python the number, name, or type of the result columns.  You can get
the number and name if the query returned more than zero rows by looking
at the row dicts, but that is unreliable.  The type information isn't
available at all.

I propose to add two functions to the result object:

.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.

Patch attached.  Comments welcome.

Re: PL/Python result metadata

От:
Alvaro Herrera <alvherre@commandprompt.com>
Дата:

Re: PL/Python result metadata

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:

Re: PL/Python result metadata

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:

Re: PL/Python result metadata

От:
Abhijit Menon-Sen <ams@toroid.org>
Дата:

Re: PL/Python result metadata

От:
Jan Urbański <wulczer@wulczer.org>
Дата:

Re: PL/Python result metadata

От:
Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Дата:

Re: PL/Python result metadata

От:
Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Дата:
FAQ