Re: Is DBLINK transactional

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: elias ghanem <e(dot)ghanem(at)acteos(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Is DBLINK transactional
Date: 2010-03-12 17:07:06
Message-ID: b42b73151003120907n1f977887y6132a564af9260b3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, Mar 12, 2010 at 10:27 AM, elias ghanem <e(dot)ghanem(at)acteos(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Davis 2010-03-12 21:54:17 Re: Is DBLINK transactional
Previous Message elias ghanem 2010-03-12 15:27:47 Is DBLINK transactional