postgresql - How to copy tuples from a DB to another -
i think got easy problem, let's see say.
i created in new db new tables called db2. , filled db called db1.
so want import tuples von db1 db2. idea following:
insert "posts" (select * de1.posts);
error: references other databases offers not implemented
then tried add in beginning:
select dblink_connect('dbname=db1'); dblink_connect
but leads syntax error.
you should try shown below. please see example:
insert t2 select * 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 );
Comments
Post a Comment