Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-18 Thread Amit Langote
Fujita-san, On 2018/05/17 21:51, Etsuro Fujita wrote: > (2018/05/17 14:19), Amit Langote wrote: >> Looking at this for a bit, I wondered if this crash wouldn't have occurred >> if the "propagation" had also considered join relations in addition to >> simple relations.  For example, if I changed in

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-17 Thread Etsuro Fujita
(2018/05/17 14:19), Amit Langote wrote: Looking at this for a bit, I wondered if this crash wouldn't have occurred if the "propagation" had also considered join relations in addition to simple relations. For example, if I changed inheritance_planner like the attached (not proposing that we consi

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-16 Thread Amit Langote
On 2018/05/17 14:19, Amit Langote wrote: > Looking at this for a bit, I wondered if this crash wouldn't have occurred > if the "propagation" had also considered join relations in addition to > simple relations. For example, if I changed inheritance_planner like the > attached (not proposing that w

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-16 Thread Amit Langote
On 2018/05/17 12:30, Etsuro Fujita wrote: > (2018/05/17 1:16), Robert Haas wrote: >> Was it just good luck that this ever worked at all?  I mean: >> >> -    if (rti<  root->simple_rel_array_size&& >> -    root->simple_rel_array[rti] != NULL) >> +    if (rti<  subroot->simple_rel_arr

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-16 Thread Etsuro Fujita
(2018/05/17 1:16), Robert Haas wrote: On Fri, May 11, 2018 at 8:46 AM, Etsuro Fujita wrote: I added an assertion test to make_modifytable to match that in create_modifytable_path. Attached is an updated version of the patch. Committed. Thanks you! Was it just good luck that this ever wo

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-16 Thread Robert Haas
On Fri, May 11, 2018 at 8:46 AM, Etsuro Fujita wrote: > I added an assertion test to make_modifytable to match that in > create_modifytable_path. Attached is an updated version of the patch. Committed. Was it just good luck that this ever worked at all? I mean: -if (rti < root->simple

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-16 Thread Etsuro Fujita
(2018/05/16 18:40), Amit Langote wrote: > On 2018/05/16 18:35, Etsuro Fujita wrote: >> I don't object to back-patching. Should I remove this from the open >> items list for PG11? > > Perhaps, keep on the page but in Older Bugs section? OK, I'll move to Older Bugs on that page and add to the next

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-16 Thread Amit Langote
Fujita-san, On 2018/05/16 18:35, Etsuro Fujita wrote: > (2018/05/14 9:45), Amit Langote wrote: >> On 2018/05/11 21:48, Etsuro Fujita wrote: >>> (2018/05/11 16:19), Amit Langote wrote: On 2018/05/11 16:12, Amit Langote wrote: > Just to clarify, does this problem only arise because there is

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-16 Thread Etsuro Fujita
(2018/05/14 9:45), Amit Langote wrote: > On 2018/05/11 21:48, Etsuro Fujita wrote: >> (2018/05/11 16:19), Amit Langote wrote: >>> On 2018/05/11 16:12, Amit Langote wrote: Just to clarify, does this problem only arise because there is a pushed down join involving the child? That is, does

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-13 Thread Amit Langote
On 2018/05/11 21:48, Etsuro Fujita wrote: > (2018/05/11 16:19), Amit Langote wrote: >> On 2018/05/11 16:12, Amit Langote wrote: >>> Just to clarify, does this problem only arise because there is a pushed >>> down join involving the child? That is, does the problem only occur as of >>> the followin

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-11 Thread Etsuro Fujita
(2018/05/11 16:19), Amit Langote wrote: > On 2018/05/11 16:12, Amit Langote wrote: >> Just to clarify, does this problem only arise because there is a pushed >> down join involving the child? That is, does the problem only occur as of >> the following commit: >> >> commit 1bc0100d270e5bcc980a0629b

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-11 Thread Etsuro Fujita
Hi Amit, (2018/05/11 16:12), Amit Langote wrote: > On 2018/05/10 21:41, Etsuro Fujita wrote: >> I think the reason for that is: in that case we try to find the target >> foreign-join RelOptInfo using find_join_rel in postgresPlanDirectModify, >> but can't find it, because the given root is the *pa

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-11 Thread Amit Langote
On 2018/05/11 16:12, Amit Langote wrote: > Just to clarify, does this problem only arise because there is a pushed > down join involving the child? That is, does the problem only occur as of > the following commit: > > commit 1bc0100d270e5bcc980a0629b8726a32a497e788 > Author: Robert Haas > Date:

Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETE joins to remote servers

2018-05-11 Thread Amit Langote
Fujita-san, On 2018/05/10 21:41, Etsuro Fujita wrote: > I think the reason for that is: in that case we try to find the target > foreign-join RelOptInfo using find_join_rel in postgresPlanDirectModify, > but can't find it, because the given root is the *parent* root and > doesn't have join RelOptI