Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault) - Mailing list pgsql-hackers

From Sean Johnston
Subject Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
Date
Msg-id CAMXPhFV-h=QRKjh4nuiqUt8weNEvFsH3H4bMpahcKhr6XtTVUw@mail.gmail.com
Whole thread Raw
Responses Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)  (Etsuro Fujita <etsuro.fujita@gmail.com>)
List 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@sss.pgh.pa.us> wrote:
Etsuro Fujita <etsuro.fujita@gmail.com> writes:
> On Sat, Apr 27, 2019 at 2:10 AM Tom Lane <tgl@sss.pgh.pa.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

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [HACKERS] proposal: schema variables
Next
From: Tom Lane
Date:
Subject: Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)