Thursday, February 7, 2013

PostgreSQL - export/import schema only

Export

Use -s to specify schema only
pg_dump <src_database_name> -s > schema.sql
(Optional) Use -t to specify table. For more than 1 table just add more -t.
 pg_dump <src_database_name> -s -t <table1_name> -t <table2_name> > schema.sql

Import
psql <dest_database_name> -f schema.sql


Credit:

No comments:

Useful commands for observe running JVM process

$ jcmd List running processes $ jinfo  Get details of a process $ jps -lvm List running processes with params