Re: Is DBLINK transactional - Mailing list pgsql-performance

From Merlin Moncure
Subject Re: Is DBLINK transactional
Date
Msg-id b42b73151003120907n1f977887y6132a564af9260b3@mail.gmail.com
Whole thread Raw
In response to Is DBLINK transactional  ("elias ghanem" <e.ghanem@acteos.com>)
Responses Re: Is DBLINK transactional
List pgsql-performance
On Fri, Mar 12, 2010 at 10:27 AM, elias ghanem <e.ghanem@acteos.com> wrote:
> Hi,
>
> I am using dblink to read data from a remote data base, insert these data in
> the local database, update the red data in the remote database then continue
> to do some other work on the local database in the same transaction.
>
> My question is : Is db link transactional; If the local transaction failed,
> would the update in the remote data base roll back or if the update in the
> remote data base failed, would the insert in the local data base roll back.
>
> If not, is there a way to make db link “transactional”?

of course.  You can always explicitly open a transaction on the remote
side over dblink, do work, and commit it at the last possible moment.
Your transactions aren't perfectly synchronized...if you crash in the
precise moment between committing the remote and the local you can get
in trouble.  The chances of this are extremely remote though.

merlin

pgsql-performance by date:

Previous
From: "elias ghanem"
Date:
Subject: Is DBLINK transactional
Next
From: Jeff Davis
Date:
Subject: Re: Is DBLINK transactional