Re: dblink: rollback transaction

Поиск
Список
Период
Сортировка
Искать
От
Joe Conway
Тема
Re: dblink: rollback transaction
Дата
Msg-id
40227D09.6060305@joeconway.com
Ответ на
Re: dblink: rollback transaction (John Sidney-Woollett)
Список
Дерево обсуждения
Re: dblink: rollback transaction "Oleg Lebedev" <oleg.lebedev@waterford.org>
Re: dblink: rollback transaction Joe Conway <mail@joeconway.com>
Re: dblink: rollback transaction Joe Conway <mail@joeconway.com>
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 по дате отправления
От: Carlos Ojea Castro
Дата:
От: John Sidney-Woollett
Дата:
FAQ