Pygresql, and query meta informations

Tim Roberts timr at
Sun Aug 16 08:07:07 CEST 2009

durumdara <durumdara at> wrote:
>Pygresql, DB-API.
>I search for a solution to get meta information about last query,
>because I must export these infos to Delphi.
>Delphi have TDataSet, and it have meta structure that must be defined
>before I create it.
>For char/varchar fields I must define their sizes!
>Pygresql is not retreive the field sizes.

You should be able to get that information from the .description member of
the cursor object.  Have you checked it?

If not, you will have to use fetch the information from the
Postgres-specific tables, pg_class and pg_attribute.  pg_class contains
information about your tables; when you fetch the class number for your
table, you can look up the columns in pg_attribute.
Tim Roberts, timr at
Providenza & Boekelheide, Inc.

More information about the Python-list mailing list