Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-admin by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group