Christoph Dalitz <christoph(dot)dalitz(at)hs-niederrhein(dot)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