Postgresql Woes

Sreekant skodela at hotmail.com
Wed Jun 13 21:31:21 CEST 2001


Hi folks

I have made a few web sites with postgresql but never needed to know
the list of tables available in the database through pg module.

I guess you can use psql and \dt command or os.popen('psql ... , to
get the list of tables. But is there a decent way of finding out
through python and postgresql [pg] module , all the tables in a
database!

eg:
con=pg.connect("mydb")
tbl=pg.query("show all tables from mydb") or something similar ??

Thanks a lot for your time
sreekant



More information about the Python-list mailing list