HomeОбразованиеRelated VideosMore From: randomtutorial

Move tables between databases PostgreSQL with a DBLINK

9 ratings | 5143 views
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 $$
Html code for embedding videos on your blog
Text Comments (4)
Nafisa Nafar (24 days ago)
Hi, i tried from my side, but the table is not created in destination. What can be the issue. Where do we need to create a link and from where we need to run the code?
Yerkebulan Duisebay (6 months ago)
select * from dblink('dbname=', 'select * from ') as accounts_cadastres_res(kad_nomer text)
moin akther (1 year ago)
which gui tool you have used in this video ?
randomtutorial (1 year ago)
Hi. Thanks for watching. I used Navicat for Postgres.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.