Re: join pushdown and issue with foreign update

2021-06-04 Thread Tom Lane
Amit Langote writes: > On Wed, Jun 2, 2021 at 4:39 PM Andrey Lepikhov > wrote: >> I played with your patch and couldn't find any errors. But what if ROW >> operation were allowed to be pushed to a foreign server? >> Potentially, I can imagine pushed-down JOIN with arbitrary ROW function >> in its

Re: join pushdown and issue with foreign update

2021-06-02 Thread Amit Langote
On Wed, Jun 2, 2021 at 4:39 PM Andrey Lepikhov wrote: > On 2/6/21 02:32, Tom Lane wrote: > > I wrote: > >> I think a preferable fix involves making sure that the correct > >> record-type typmod is propagated to record_in in this context. > >> Alternatively, maybe we could insert the foreign table'

Re: join pushdown and issue with foreign update

2021-06-02 Thread Alexander Pyhalov
Tom Lane писал 2021-06-02 00:32: I wrote: I think a preferable fix involves making sure that the correct record-type typmod is propagated to record_in in this context. Alternatively, maybe we could insert the foreign table's rowtype during execution of the input operation, without touching the p

Re: join pushdown and issue with foreign update

2021-06-02 Thread Amit Langote
On Wed, Jun 2, 2021 at 6:32 AM Tom Lane wrote: > I wrote: > > I think a preferable fix involves making sure that the correct > > record-type typmod is propagated to record_in in this context. > > Alternatively, maybe we could insert the foreign table's rowtype > > during execution of the input ope

Re: join pushdown and issue with foreign update

2021-06-02 Thread Andrey Lepikhov
On 2/6/21 02:32, Tom Lane wrote: I wrote: I think a preferable fix involves making sure that the correct record-type typmod is propagated to record_in in this context. Alternatively, maybe we could insert the foreign table's rowtype during execution of the input operation, without touching the p

Re: join pushdown and issue with foreign update

2021-06-01 Thread Tom Lane
I wrote: > I think a preferable fix involves making sure that the correct > record-type typmod is propagated to record_in in this context. > Alternatively, maybe we could insert the foreign table's rowtype > during execution of the input operation, without touching the > plan as such. Here's a dra

Re: join pushdown and issue with foreign update

2021-06-01 Thread Tom Lane
Alexander Pyhalov writes: > Tom Lane писал 2021-06-01 21:19: >> ISTM that using a specific rowtype rather than RECORD would be >> quite disastrous from the standpoint of bloating the number of >> distinct resjunk columns we need for a partition tree with a >> lot of children. Maybe we'll have to

Re: join pushdown and issue with foreign update

2021-06-01 Thread Alexander Pyhalov
Tom Lane писал 2021-06-01 21:19: Alexander Pyhalov writes: What about the following patch? ISTM that using a specific rowtype rather than RECORD would be quite disastrous from the standpoint of bloating the number of distinct resjunk columns we need for a partition tree with a lot of children

Re: join pushdown and issue with foreign update

2021-06-01 Thread Tom Lane
Alexander Pyhalov writes: > What about the following patch? ISTM that using a specific rowtype rather than RECORD would be quite disastrous from the standpoint of bloating the number of distinct resjunk columns we need for a partition tree with a lot of children. Maybe we'll have to go that way,

Re: join pushdown and issue with foreign update

2021-06-01 Thread Alexander Pyhalov
Amit Langote писал 2021-06-01 15:47: Perhaps, we can get away with adding the wholerow Var with the target relation's reltype when the target foreign table is not a "child" relation, but the root target relation itself. Maybe like the attached? Hi. I think the patch fixes this issue, but it

Re: join pushdown and issue with foreign update

2021-06-01 Thread Amit Langote
Hi, On Tue, Jun 1, 2021 at 1:04 AM Alexander Pyhalov wrote: > > Alexander Pyhalov писал 2021-05-31 15:39: > > Hi. > > > > There's issue with join pushdown after > > > > commit 86dc90056dfdbd9d1b891718d2e5614e3e432f35 > > Author: Tom Lane > > Date: Wed Mar 31 11:52:34 2021 -0400 > > > ... > > Y

Re: join pushdown and issue with foreign update

2021-05-31 Thread Alexander Pyhalov
Alexander Pyhalov писал 2021-05-31 15:39: Hi. There's issue with join pushdown after commit 86dc90056dfdbd9d1b891718d2e5614e3e432f35 Author: Tom Lane Date: Wed Mar 31 11:52:34 2021 -0400 ... You'll get ERROR: input of anonymous composite types is not implemented CONTEXT: whole-row refer

join pushdown and issue with foreign update

2021-05-31 Thread Alexander Pyhalov
Hi. There's issue with join pushdown after commit 86dc90056dfdbd9d1b891718d2e5614e3e432f35 Author: Tom Lane Date: Wed Mar 31 11:52:34 2021 -0400 Rework planning and execution of UPDATE and DELETE To make sure that join pushdown path selected, one can patch contrib/postgres_fdw/postgres_