Re: ERROR: no relation entry for relid 6

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR: no relation entry for relid 6
Date: 2023-06-08 21:13:39
Message-ID: 239048.1686258819@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> On Tue, May 30, 2023 at 10:28 AM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
>> I haven't thought through how to fix it, but I suspect that we may need
>> to do more checking before we decide to remove PHVs in
>> remove_rel_from_query.

Oh, I like this example! It shows a place where we are now smarter
than we used to be, because v15 and earlier fail to recognize that
the join could be removed. But we do have to clean up the query
properly afterwards.

> Hmm, maybe we can additionally check if the PHV needs to be evaluated
> above the join. If so it cannot be removed.

Yeah, that seems to make sense, and it squares with the existing
comment saying that PHVs used above the join can't be removed.
Pushed that way.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2023-06-08 21:15:39 Re: Order changes in PG16 since ICU introduction
Previous Message Andres Freund 2023-06-08 20:26:34 Re: Let's make PostgreSQL multi-threaded