Postgresql – How to make an alias for a common query to run on any database?
I often find myself wanting to run a query like this on multiple different databases: select n, pg_size_pretty(s) from ( select n, pg_total_relation_size(n) s from ( select format('%I.%I', table_schema, table_name) n from information_schema.tables ) ) order by s desc; How…