From: <gh...@gh...> - 2003-08-13 00:44:12
|
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 |