Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "lxndrkrlv(at)gmail(dot)com" <lxndrkrlv(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause
Date: 2022-08-19 14:21:00
Message-ID: Yv+cTDKXsaLrOwMo@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Aug 18, 2022 at 10:07:02PM -0400, Bruce Momjian wrote:
> > While we don't insist that hints be 100% accurate, it's not good
> > if they're wildly unhelpful. So I'm not sure if we can determine
> > whether or not it's likely to be on-point.
> >
> > I didn't look too closely at your other examples.
>
> Yeah, I think someone will have to have a new idea to improve this.

Thinking some more, my point is that this error message is being
generated for three cases I know of:

1. email reporters case of CTID column, which is fixed by table
qualification

2. adding LATERAL

3. UPDATE/DELETE where adding LATERAL doesn't fix the query

We can't simply improve the error message because there are unfixable
cases, and we know of two possible fixes.

To improve things, it would be good if we could determine if LATERAL
will really fix the error, or at least detect one of the cases above we
have a clearer way to suggest a fix.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Indecision is a decision. Inaction is an action. Mark Batterson

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2022-08-19 15:13:59 BUG #17590: [OPTIMIZER] DELETE never ends on a small table, found a workaround which makes it instant
Previous Message Bruce Momjian 2022-08-19 02:07:02 Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause