Re: Inserting data in other db

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Toff <kristoff(dot)six(at)telenet(dot)be>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Inserting data in other db
Date: 2005-09-06 13:16:23
Message-ID: 20050906131623.GA5256@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Sep 01, 2005 at 01:09:55PM +0000, Toff wrote:
> I want to insert data from a table in a database to a table of another
> database when the data is added in the first table, thus using a trigger on
> the 1st table.
> So, is there some way to acces a 2nd database within functions of the 1st
> database? Or do I have to write an extrenal application to do the
> datatransfer?

You could use contrib/dblink or a function written in a procedural
language like PL/Perl that can access external data sources, but
beware that you won't get transactional semantics. If you roll
back the transaction in the first database, you don't have a way
to propogate that rollback to the second database.

--
Michael Fuhr

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2005-09-06 14:33:18 Re: Last Id?
Previous Message me 2005-09-06 10:22:31 Re: howto to do an automated backup on windows xp?