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

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -