Re: 'dblink' Help - Mailing list pgsql-admin

From Joe Conway
Subject Re: 'dblink' Help
Date
Msg-id 401C042E.5000705@joeconway.com
Whole thread Raw
In response to 'dblink' Help  (JinNet Picker <netpicker9@yahoo.com>)
List pgsql-admin
JinNet Picker wrote:

> What i need is, when ever a NEW record is inserted in
> 'MyDb1' , i want fire a Trigger or Rule to insert the
> Same Record to MyDb2 database.

> Anybody Got Idea how to do this?

See the dblink documentation for dblink_exec(), and see the Postgres
documentation for how to create triggers:
http://www.postgresql.org/docs/current/static/triggers.html
You'll probably want to create the trigger function using PL/pgSQL:
http://www.postgresql.org/docs/current/static/plpgsql.html

Joe



pgsql-admin by date:

Previous
From: "Sally Sally"
Date:
Subject: Separating a single database into different disks
Next
From: "JSaula"
Date:
Subject: How do I do download of pgadmin III?