I want to insert same data in db_two.tab_emp table automatic by trigger or anything.

create database db_one;
create table db_one.tab_emp(id int, name text);

create database db_two;
create table db_two.tab_emp(id int, name text);

insert into db_one.tab_emp values(101,'king');

Is there any possible way to insert or update foreign database table if I insert or update own database table at a time?

  • 1
    yes it's possible, you can use replication, or you can use a trigger that uses db_link. – Jasen Aug 11 '18 at 1:19
  • can you please give me a example? @Jasen – Mojib Aug 13 '18 at 3:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.