Catalog tables provides invaluable information to maintain and automate database administration tasks. For example, in the previous section, we were able to dump a tree of dependent objects in the correct order. In addition to that, one can automate daily tasks checks such as bloats, locks, size, and database health. Also, with the usage of statistical table, we were able to detect unused indexes, as well as potential columns which require indexing such as foreign keys columns.
The PostgreSQL catalog contains meta information about PostgreSQL databases and objects. This information can be retrieved and manipulated using SQL statements. However, it is not recommended to manipulate the data directly in a catalog schema. PostgreSQL also provides a convenient way to extract data by providing user friendly information in information_schema.
With the help of...