Skip to content

Instantly share code, notes, and snippets.

@axmad386
Created January 31, 2026 04:49
Show Gist options
  • Select an option

  • Save axmad386/eb7179144d1badca03d53a4d30b00775 to your computer and use it in GitHub Desktop.

Select an option

Save axmad386/eb7179144d1badca03d53a4d30b00775 to your computer and use it in GitHub Desktop.
PostgreSQL CheatSheet

PostgreSQl Commands to Make a Better Life

Show usage for all tables in db across schema

docker exec -t [containername] psql -U [dbusername] -d [dbname] -c "SELECT relname, pg_size_pretty(pg_total_relation_size(relid)) FROM pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment