I am trying to copy an entire table from one database to another in Postgres. Any suggestions?
First install dblink
Then, you would do something like:
INSERT INTO t2 select * from dblink('host=1.2.3.4 user=***** password=****** dbname=D1', 'select * t1') tt( id int, col_1 character varying, col_2 character varying, col_3 int, col_4 varchar );