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:

Collectd PostgreSQL Plugin

I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresql