Move tables between databases PostgreSQL with a DBLINK

Published: 08 April 2017
on channel: randomtutorial
25,038
100

Blog:
http://bearsnack.co.uk

Move tables between databases PostgreSQL with a DBLINK

do $$ declare r record ;
begin
for r in select *
from dblink ('host=localhost
user=postgres
password=password
dbname=source',
'select indexdef
from pg_indexes
where tablename = ''mytable''') as linktable (
indexdef text ) loop
execute r.indexdef;
end loop;
end $$


Watch video Move tables between databases PostgreSQL with a DBLINK online without registration, duration hours minute second in high quality. This video was added by user randomtutorial 08 April 2017, don't forget to share it with your friends and acquaintances, it has been viewed on our site 25,03 once and liked it 10 people.