Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-11-10 Thread Etsuro Fujita
(2017/11/01 11:16), Robert Haas wrote: On Wed, Oct 4, 2017 at 5:58 PM, Ashutosh Bapat wrote: The view with WCO is local but the modification which violates WCO is being made on remote server by a trigger on remote table. Trying to control that doesn't seem to be a good idea, just like we can't

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-10-31 Thread Robert Haas
On Wed, Oct 4, 2017 at 5:58 PM, Ashutosh Bapat wrote: > The view with WCO is local but the modification which violates WCO is > being made on remote server by a trigger on remote table. Trying to > control that doesn't seem to be a good idea, just like we can't > control what rows get inserted on

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-10-05 Thread Etsuro Fujita
On 2017/10/05 20:06, Kyotaro HORIGUCHI wrote: Since WCO ensures finally inserted values, we can't do other than acturally requesting for the values. I think so too. So just merging WCO columns to RETURNING in deparsed query is ok. But can't we concatenate returningList and withCheckOptionList

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-10-05 Thread Kyotaro HORIGUCHI
At Thu, 5 Oct 2017 18:08:50 +0900, Etsuro Fujita wrote in <60e94494-4e5d-afed-e482-b9ad1986b...@lab.ntt.co.jp> > On 2017/10/04 21:28, Ashutosh Bapat wrote: > > On Wed, Oct 4, 2017 at 5:32 PM, Robert Haas > > wrote: > >> On Wed, Oct 4, 2017 at 6:40 AM, Ashutosh Bapat > >> wrote: > >>> We can > >

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-10-05 Thread Etsuro Fujita
On 2017/10/04 21:28, Ashutosh Bapat wrote: On Wed, Oct 4, 2017 at 5:32 PM, Robert Haas wrote: On Wed, Oct 4, 2017 at 6:40 AM, Ashutosh Bapat wrote: We can check whether a row being sent from the local server to the foreign server obeys WCO, but what foreign server does to that row is beyond l

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-10-04 Thread Ashutosh Bapat
On Wed, Oct 4, 2017 at 5:32 PM, Robert Haas wrote: > On Wed, Oct 4, 2017 at 6:40 AM, Ashutosh Bapat > wrote: >> Just like the local constraints on a foreign table are not ensured on >> remote table (unless user takes steps to make that sure), WCO defined >> locally need not be (and probably can n

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-10-04 Thread Robert Haas
On Wed, Oct 4, 2017 at 6:40 AM, Ashutosh Bapat wrote: > Just like the local constraints on a foreign table are not ensured on > remote table (unless user takes steps to make that sure), WCO defined > locally need not be (and probably can not be) ensured remotely. We can > check whether a row being

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-10-04 Thread Ashutosh Bapat
On Wed, Oct 4, 2017 at 3:45 PM, Etsuro Fujita wrote: > On 2017/10/03 18:16, Ashutosh Bapat wrote: >> >> Enforcing WCO constraints imposed by the local server on the row/DML >> being passed to the foreign server is fine, but trying to impose them >> on the row being inserted/updated at the foreign

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-10-04 Thread Etsuro Fujita
On 2017/10/03 18:16, Ashutosh Bapat wrote: Enforcing WCO constraints imposed by the local server on the row/DML being passed to the foreign server is fine, but trying to impose them on the row being inserted/updated at the foreign server looks odd. May be we should just leave this case as it is.

Re: [HACKERS] Another oddity in handling of WCO constraints in postgres_fdw

2017-10-03 Thread Ashutosh Bapat
On Thu, Sep 28, 2017 at 5:45 PM, Etsuro Fujita wrote: > Hi, > > Commit 7086be6e3627c1ad797e32ebbdd232905b5f577f addressed mishandling of WCO > in direct foreign table modification by disabling it when we have WCO, but I > noticed another oddity in postgres_fdw: > > postgres=# create table base_tbl