Re: inherit support for foreign tables

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Noah Misch <noah(at)leadboat(dot)com>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: inherit support for foreign tables
Date: 2014-12-08 12:10:37
Message-ID: 5485953D.6080306@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

(2014/12/08 15:17), Ashutosh Bapat wrote:
> On Sat, Dec 6, 2014 at 9:21 PM, Noah Misch <noah(at)leadboat(dot)com
> <mailto:noah(at)leadboat(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-12-08 14:31:07 Re: advance local xmin more aggressively
Previous Message Anssi Kääriäinen 2014-12-08 10:43:54 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}