Re: inherit support for foreign tables - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: inherit support for foreign tables
Date
Msg-id 5485953D.6080306@lab.ntt.co.jp
Whole thread Raw
In response to Re: inherit support for foreign tables  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers
(2014/12/08 15:17), Ashutosh Bapat wrote:
> On Sat, Dec 6, 2014 at 9:21 PM, Noah Misch <noah@leadboat.com
> <mailto:noah@leadboat.com>> wrote:
>     Does this inheritance patch add any
>     atomicity
>     problem that goes away when one breaks up the inheritance hierarchy and
>     UPDATEs each table separately?  If not, this limitation is okay.

> If the UPDATES crafted after breaking up the inheritance hierarchy are
> needed to be run within the same transaction (as the UPDATE on
> inheritance hierarchy would do), yes, there is atomicity problem.

ISTM that your concern would basically a known problem.  Consider the 
following transaction.

BEGIN TRANSACTION;
UPDATE foo SET a = 100;  -- updates on table foo in remote server1
UPDATE bar SET a = 100;  -- updates on table bar in remote server2
COMMIT TRANSACTION;

This transaction would cause the atomicity problem if 
pgfdw_xact_callback() for XACT_EVENT_PRE_COMMIT for foo succeeded and 
then that for bar failed during CommitTransaction().

Thanks,

Best regards,
Etsuro Fujita



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [Windows,PATCH] Use faster, higher precision timer API
Next
From: Robert Haas
Date:
Subject: Re: advance local xmin more aggressively