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

2018-07-09 Thread Etsuro Fujita
(2018/07/09 9:00), Jeff Davis wrote: Committed. I made some small modifications and added a test for the case where the foreign table is a partition of a local table, which follows a different code path after commit 3d956d95. Great! Thanks for revising and committing, Jeff. Thanks for review

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

2018-07-08 Thread Jeff Davis
On Tue, 2018-03-06 at 20:09 +0900, Etsuro Fujita wrote: > Agreed.  I added a comment to that function.  I think that that > comment  > in combination with changes to the FDW docs in the patch would help > FDW  > authors understand why that is needed.  Please find attached an > updated  > version of

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

2018-03-16 Thread Ashutosh Bapat
On Tue, Mar 13, 2018 at 8:34 PM, Stephen Frost wrote: > > It would really help to have some examples of exactly what is being > proposed here wrt solutions. > > WCO is defined at a view level, so I'm not following the notion that > we're going to depend on something remote to enforce the WCO when

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

2018-03-13 Thread Stephen Frost
Greetings, * Ashutosh Bapat (ashutosh.ba...@enterprisedb.com) wrote: > On Mon, Mar 12, 2018 at 1:25 PM, Etsuro Fujita > wrote: > > (2018/03/09 20:55), Etsuro Fujita wrote: > >> (2018/03/08 14:24), Ashutosh Bapat wrote: > >>> For local constraints to be enforced, we use remote > >>> constraints. F

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

2018-03-12 Thread Ashutosh Bapat
On Mon, Mar 12, 2018 at 1:25 PM, Etsuro Fujita wrote: > (2018/03/09 20:55), Etsuro Fujita wrote: >> >> (2018/03/08 14:24), Ashutosh Bapat wrote: >>> >>> For local constraints to be enforced, we use remote >>> constraints. For local WCO we need to use remote WCO. That means we >>> create many forei

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

2018-03-12 Thread Etsuro Fujita
(2018/03/09 20:55), Etsuro Fujita wrote: (2018/03/08 14:24), Ashutosh Bapat wrote: For local constraints to be enforced, we use remote constraints. For local WCO we need to use remote WCO. That means we create many foreign tables pointing to same local table on the foreign server through many vi

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

2018-03-09 Thread Etsuro Fujita
Hi Ashutosh, (2018/03/08 14:24), Ashutosh Bapat wrote: Etsuro said [2] that WCO constraints can not be implemented on foreign server and normal check constraints can be, and for that he provides an example in [3]. But I think that example is going the wrong direction. More precisely, what I'm

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

2018-03-07 Thread Ashutosh Bapat
On Wed, Mar 7, 2018 at 8:55 AM, Stephen Frost wrote: > Greetings Robert, Ashutosh, Arthur, Etsuro, all, > > * Arthur Zakirov (a.zaki...@postgrespro.ru) wrote: >> On Tue, Mar 06, 2018 at 08:09:50PM +0900, Etsuro Fujita wrote: >> > Agreed. I added a comment to that function. I think that that comm

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

2018-03-06 Thread Stephen Frost
Greetings Robert, Ashutosh, Arthur, Etsuro, all, * Arthur Zakirov (a.zaki...@postgrespro.ru) wrote: > On Tue, Mar 06, 2018 at 08:09:50PM +0900, Etsuro Fujita wrote: > > Agreed. I added a comment to that function. I think that that comment in > > combination with changes to the FDW docs in the pa

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

2018-03-06 Thread Arthur Zakirov
On Tue, Mar 06, 2018 at 08:09:50PM +0900, Etsuro Fujita wrote: > Agreed. I added a comment to that function. I think that that comment in > combination with changes to the FDW docs in the patch would help FDW authors > understand why that is needed. Please find attached an updated version of > t

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

2018-03-06 Thread Etsuro Fujita
(2018/03/06 1:57), Arthur Zakirov wrote: IMHO, it is worth to add more explaining comment into deparseReturningList, why it is necessary to merge WCO attributes to RETURNING clause. You already noted it in the thread. I think it could confuse someone who not very familiar how RETURNING is related

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

2018-03-05 Thread Arthur Zakirov
On Mon, Mar 05, 2018 at 09:44:37PM +0900, Etsuro Fujita wrote: > I rebased the patch over HEAD. Please find attached an updated patch. Thank you! IMHO, it is worth to add more explaining comment into deparseReturningList, why it is necessary to merge WCO attributes to RETURNING clause. You alrea

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

2018-03-05 Thread Etsuro Fujita
Hi Arthur, (2018/03/03 18:51), Arthur Zakirov wrote: On Wed, Feb 28, 2018 at 05:22:42PM +0900, Etsuro Fujita wrote: I rebased the patch over HEAD and revised comments/docs a little bit. Please find attached a new version of the patch. I've reviewed the patch. The code is good, clear and it i

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

2018-03-03 Thread Arthur Zakirov
Hello, On Wed, Feb 28, 2018 at 05:22:42PM +0900, Etsuro Fujita wrote: > I rebased the patch over HEAD and revised comments/docs a little bit. Please > find attached a new version of the patch. I've reviewed the patch. The code is good, clear and it is pretty small. There are documentation fixes

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

2018-02-28 Thread Etsuro Fujita
(2018/01/18 16:16), Etsuro Fujita wrote: Attached is a rebased patch. I rebased the patch over HEAD and revised comments/docs a little bit. Please find attached a new version of the patch. Best regards, Etsuro Fujita *** a/contrib/postgres_fdw/deparse.c --- b/contrib/postgres_fdw/deparse.c *

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

2018-01-17 Thread Etsuro Fujita
(2018/01/17 22:00), Stephen Frost wrote: Reviewing this thread, I tend to agree with Etsuro and I'm not sure I see where there's a good argument for having a foreign table under a view behave differently than a local table under a view for WCO (which is an option of the view- not about the table

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

2018-01-17 Thread Stephen Frost
Greetings Etsuro, Robert, all, * Etsuro Fujita (fujita.ets...@lab.ntt.co.jp) wrote: > (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

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

2017-11-28 Thread Michael Paquier
On Fri, Nov 10, 2017 at 8:36 PM, Etsuro Fujita wrote: > For local constraints on foreign tables, it's the user's responsibility to > ensure that those constraints matches the remote side, so we don't need to > ensure those constraints locally. But I'm not sure if the same thing > applies to WCOs