From: robert a. <rd...@pa...> - 2003-08-13 02:45:29
|
On Tuesday, August 12, 2003, at 05:17 PM, Gerhard H=E4ring wrote: > robert ackerman wrote: >> is it possible (easy?) to get field names and types from postgresql=20= >> using pyPgSQL? >> i did it before using libpq calls, but can it be done with the high=20= >> level interface? >> guess i can use high level for everything except getting=20 >> fieldnames/types. > > I don't know exactly what you mean. The only meta-information pyPgSQL=20= > readily offers is that mandated by the DB-API. the .description field=20= > of the cursor object. > > If what you want is look which columns/types a table/view has, I'd=20 > recommend you start psql with the option -E and hit \d tablename, then=20= > look at the select that psql uses. You should be able to easily adapt=20= > it to your needs. > i meant in a cgi script where it is desired to show table entries with=20= column names and types out to the client's browser. 'description' is=20 what i want. thanks. |