Re: dblink: rollback transaction - Mailing list pgsql-general

From Joe Conway
Subject Re: dblink: rollback transaction
Date
Msg-id 40227D09.6060305@joeconway.com
Whole thread Raw
In response to Re: dblink: rollback transaction  ("John Sidney-Woollett" <johnsw@wardbrook.com>)
List pgsql-general
John Sidney-Woollett wrote:
>
> I think PG badly needs nested transaction support... ;)

I think that is a main take-away here. You should not try to depend on
dblink as a robust replication solution. Perhaps if postgres had
two-phase commit and nested transactions, but not at the moment.

That said, depending on how you are implementing the loop in your
pseudo-code, you might be able to get closer by using persistent dblink
connections, and starting a transaction on the remote side before
starting the local transaction and running your plpgsql function (or
whatever it is you're running). If the local transaction fails, send an
ABORT to the remote side before closing the connection. However I can't
offhand think of a way to do that in an automated fashion.

Joe


pgsql-general by date:

Previous
From: Carlos Ojea Castro
Date:
Subject: Re: Proper tool to display graphics?
Next
From: "John Sidney-Woollett"
Date:
Subject: Re: performance difference: multiple db vs single db