How to get database metadata information (i.e. existing tables and columns in tables)

Mathias Waack M.Waack at gmx.de
Tue Aug 22 08:13:43 EDT 2006


Chris Brat wrote:

> Is it possible to retrieve details about the database, specifically a
> list of the tables in the database; and then to retrieve the columns
> and their types for the tables?

Yes. 

> Is this dependant on the database?

Yes. 

Real databases usually store meta-data (list of tables, list of columns,
list of indexes aso...) in system tables which can be queried in the same
manner as common tables or view. Just read your database handbook...

HTH
        Mathias




More information about the Python-list mailing list