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

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: (view raw, whole thread or download thread mbox)
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

pgsql-novice by date

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

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