Re: fielldnames

Gerhard Häring <[email protected]> Wed, 13 Aug 2003 02:17:31 +0200
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
robert ackerman wrote:
> is it possible (easy?) to get field names and types from postgresql 
> using pyPgSQL?
> i did it before using libpq calls, but can it be done with the high 
> level interface?
> guess i can use high level for everything except getting fieldnames/types.

I don't know exactly what you mean. The only meta-information pyPgSQL 
readily offers is that mandated by the DB-API. the .description field of 
the cursor object.

If what you want is look which columns/types a table/view has, I'd 
recommend you start psql with the option -E and hit \d tablename, then 
look at the select that psql uses. You should be able to easily adapt it 
to your needs.

Or did you mean something different?

-- Gerhard


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01