Postgresql Woes

Oleg Broytmann phd at phd.fep.ru
Wed Jun 13 15:53:12 EDT 2001


On 13 Jun 2001, Sreekant wrote:
> 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!

   psql does not do any magic. I remember there is a parameter that you cm
set and psql will echo the query that it sends to the server. Then you can
copy the query into your program.

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list