pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: JinNet Picker <netpicker9@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: 'dblink' Help
Date: Sat, 31 Jan 2004 11:38:22 -0800
Message-ID: <401C042E.5000705@joeconway.com> (raw)
In-Reply-To: <20040127105326.97350.qmail@web9402.mail.yahoo.com>
References: <20040127105326.97350.qmail@web9402.mail.yahoo.com>

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





view thread (2+ messages)

Message-ID: <401C042E.5000705@joeconway.com>
Permalink:  ../401C042E.5000705@joeconway.com/
Also on:    postgresql.org/message-id/401C042E.5000705@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mail@joeconway.com, netpicker9@yahoo.com
  Subject: Re: 'dblink' Help
  In-Reply-To: <401C042E.5000705@joeconway.com>
  References: <20040127105326.97350.qmail@web9402.mail.yahoo.com> <401C042E.5000705@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox