/ Published in: Bash
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# Development Server psql database_name CREATE TABLE temp_table_name AS SELECT * FROM actual_table WHERE some_field = 'some_value' ORDER BY some_field; \q pg_dump -t temp_table_name database_name | gzip > temp_table_name.sql.gz scp temp_table_name.sql.gz user@server: psql database_name DROP TABLE temp_table_name; # Production Server zcat temp_table_name.sql.gz | psql database_name psql database_name INSERT INTO actual_table SELECT * FROM temp_table_name; DROP TABLE temp_table_name;