Relational databases like Postgres include a set of tables that describe the tables in the database. This set of metadata tables is called the **catalog **and it contains a treasure trove of details about the database. I recently needed to write a program to automatically extract insights from database catalogs and this led me to write a simple Python module to connect to a Postgres database, get information from the catalog, and load that information into a Pandas dataframe for further processing in Python. This article describes the process I followed.
One of the key facts about Postgres is that it has not one but two catalogs:
#catalog #relational-databases #postgres #python #data-science