posted on Jul 28, 2009 at 6:15 p.m. EDT in
pg_dump -d prod_db -U prod_db -h localhost > /tmp/transferdump.sql
psql -U prod_db_user -h localhost -t -d other_db -c "SELECT 'DROP TABLE ' || n.nspname || '.' ||
c.relname || ' CASCADE;' FROM pg_catalog.pg_class AS c LEFT JOIN
pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace WHERE relkind =
'r' AND n.nspname NOT IN ('pg_catalog', 'pg_toast') AND
pg_catalog.pg_table_is_visible(c.oid)" >/tmp/dropothertables.sql;
psql -d other_db -h localhost -U other_db_user < /tmp/dropothertables.sql;
psql -d other_db -h localhost -U other_db_user < /tmp/transferdump.sql
bash
1
pg_dump -d prod_db -U prod_db -h localhost > /tmp/transferdump.sql
psql -U prod_db_user -h localhost -t -d other_db -c "SELECT 'DROP TABLE ' || n.nspname || '.' ||
c.relname || ' CASCADE;' FROM pg_catalog.pg_class AS c LEFT JOIN
pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace WHERE relkind =
'r' AND n.nspname NOT IN ('pg_catalog', 'pg_toast') AND
pg_catalog.pg_table_is_visible(c.oid)" >/tmp/dropothertables.sql;
psql -d other_db -h localhost -U other_db_user < /tmp/dropothertables.sql;
psql -d other_db -h localhost -U other_db_user < /tmp/transferdump.sql
copy
|
embed
Hey there! I see you're running Internet Explorer 6.
That's neat. This reminds me of my grandpa. He had this old car that he kept having to fix. He spent so much money on it that he didn't want to get rid of it (even when it stopped running).
You guys should hang out.
Here's a free sports car from Snipt.
0 Comments