Created
October 3, 2018 14:17
-
-
Save efrecon/21ebe0214a4d34cbc176d39727da790c to your computer and use it in GitHub Desktop.
List all tables in a given postgres db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "SELECT table_schema || '.' || table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog', 'information_schema');" | psql -U postgres -d dbname -q -t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment