Christoph Dalitz <christoph.dalitz@hs-niederrhein.de> writes:
>> How can I get a list of existing databases or tables ?
>>
> Check the chapter "System Catalog" in the "Developer's Guide";
> esp. have a look at pg_class and pg_database.
Also see the backslash commands in psql (\dt and \l in this case).
regards, tom lane