Truquis de postgres

Pasar tablas entre bases de datos

truncate table tableA;
insert into tableA
select *
from dblink('dbname=postgres hostaddr=xxx.xxx.xxx.xxx dbname=mydb user=postgres',
'select a,b from tableA')
as t1(a text,b text);
Posted in Uncategorized