Is there a way that I can make a metadata-sheet that lists all the available tables from a postgresql-database, so users can see documentation of the tables?

I know that there are descriptions, column names, number of rows and several more information that could do as metadata for the specific database. But when i have something like 36 tables I'd like to make a documentation of, then I am looking for at way to just generate a table of the metadata of the tables.


If you want something quick and dirty, I would just use psql to dump out all the tables.

for t in $(psql -Ac '\dt' | awk -F'|' '$3 == "table" {print $2}');
    psql -c "\\d $t"
done > metadata.tables

Job done.

Not the answer you're looking for? Browse other questions tagged or ask your own question.