Postgresql Woes

Thomas Weholt thomas at cintra.no
Wed Jun 13 15:59:41 EDT 2001


Look at the examples in the PyGreSQL-package. I believe there's some
examples doing this exact thing.


"Sreekant" <skodela at hotmail.com> wrote in message
news:436ad7a4.0106131131.57bc1cd1 at posting.google.com...
> 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