Copy table from one database to another

posted Oct 30, 2014, 12:38 PM by Sachchida Ojha
There are many ways to copy the table. If table is large then use of gpfdist and external table is more efficient. For small look up tables you can use regular postgresql copy command.

psql -X -U user -h host1 -d db1  -c "\\copy users to stdout"  | psql  -X  -U user -h host2 -d db2 -c "\\copy users from stdin"