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:
Post a Comment