Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)

From: Sean Johnston <sean(dot)johnston(at)edgeintelligence(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
Date: 2019-05-24 17:19:30
Message-ID: CAMXPhFV-h=QRKjh4nuiqUt8weNEvFsH3H4bMpahcKhr6XtTVUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Not sure if this is the right avenue to follow up on this. The patch works
fine. However, we're working on a modified version of the postgres_fdw in
which we're trying to push as much as possible to the remote nodes,
including ordering and limits. The patch causes the upper paths for the
ordering and limit to be rejected as they have no relids. I've had a quick
look at maybe how to pull in relids in the fdw private data but its not
obvious. Obviously this isn't mainstream postgres but just wondering if
anyone has looked into issues with regards to pushing order/limit to remote
nodes for fdw.

On Sat, Apr 27, 2019 at 3:47 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> writes:
> > On Sat, Apr 27, 2019 at 2:10 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> If we don't want to change what the core code does with fdw_exprs,
> >> I think the only way to fix it is to hack postgres_fdw so that it
> >> won't generate plans involving the problematic case.
>
> > Seems reasonable.
>
> >> See attached.
>
> > I read the patch. It looks good to me. I didn't test it, though.
>
> Thanks for looking! Have a good vacation ...
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-05-24 17:59:01 Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
Previous Message Tom Lane 2019-05-24 15:16:53 Re: BUG #15819: wrong expression in document of pgbench

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-05-24 17:59:01 Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
Previous Message Pavel Stehule 2019-05-24 17:12:13 Re: [HACKERS] proposal: schema variables