Re: 'dblink' Help

From: Joe Conway <mail(at)joeconway(dot)com>
To: JinNet Picker <netpicker9(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: 'dblink' Help
Date: 2004-01-31 19:38:22
Message-ID: 401C042E.5000705@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Gaetano Mendola 2004-02-01 01:58:52 release note missing
Previous Message Sally Sally 2004-01-31 18:52:06 Separating a single database into different disks