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

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, sean(dot)johnston(at)edgeintelligence(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
Date: 2019-04-27 13:30:37
Message-ID: CAPmGK15OYdYVMgUMEOBO2Z_QU+Vsz2XbLJhp0ze6m-7bZ3nqww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Sat, Apr 27, 2019 at 2:10 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> > (2019/04/26 3:24), Tom Lane wrote:
> >> If we do leave it like this, then the only way for postgres_fdw to
> >> avoid trouble is to not have any entries in fdw_exprs that exactly
> >> match entries in fdw_scan_tlist. So that pretty much devolves back
> >> to what I said before: don't ship values to the far end that are
> >> just going to be fed back as-is. But now it's a correctness
> >> requirement not just an optimization.

> Well, the releases are coming up fast, so I spent some time on this.
> 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.

> We end up with slightly weird-looking plans if the troublesome Param
> is actually a GROUP BY expression, but if it's not, I think things
> are fine. Maybe we could do something smarter about the GROUP BY case,
> but it seems weird enough to maybe not be worth additional trouble.

Agreed.

Thanks for working on this!

Best regards,
Etsuro Fujita

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jonathan S. Katz 2019-04-27 13:31:50 Re: BUG #15706: Support Services page out of date
Previous Message Andrew Gierth 2019-04-27 11:45:09 Re: Reg: Postgresql8.3 Using on Ubuntu

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2019-04-27 14:05:20 Re: [PATCH v1] Add \echo_stderr to psql
Previous Message Peter Eisentraut 2019-04-27 12:16:01 Re: Identity columns should own only one sequence