Re: fielldnames

robert ackerman <rdacker-yBeKhBN/[email protected]> Tue, 12 Aug 2003 19:10:31 -0700
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
On Tuesday, August 12, 2003, at 05:17  PM, Gerhard Häring wrote:

> 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.
>
i meant in a cgi script where it is desired to show table entries with 
column names and types out to the client's browser.  'description' is 
what i want. thanks.



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