Redshift Notes: Difference between revisions
From Federal Burro of Information
Jump to navigationJump to search
(Created page with " list of schemas: echo "select nspname from pg_namespace where nspowner = 100;" | psql -t -A") |
No edit summary |
||
Line 1: | Line 1: | ||
get all schemas: | |||
echo "select nspname from pg_namespace where nspowner = 100;" | psql -t -A > list_of_user_schemas.txt | |||
echo | dump each schema | ||
for i in `cat list_of_user_schemas.txt`; do echo $i; pg_dump -s -n $i > $i.schema; done |
Latest revision as of 20:00, 22 November 2018
get all schemas:
echo "select nspname from pg_namespace where nspowner = 100;" | psql -t -A > list_of_user_schemas.txt
dump each schema
for i in `cat list_of_user_schemas.txt`; do echo $i; pg_dump -s -n $i > $i.schema; done