On Mon, Jun 5, 2023, 07:40 Hans Buschmann <buschm...@nidsa.net> wrote:
> I have reworked the case of BUG #17842 to include the data and the > questions for further investigation. > > > The problem is NOT to correct the query to a working case, but to show a > fundamental problem with qual pushdown. > The optimization system operates with imperfect information, meaning it assumes expressions do not produce errors depending on the data. If you know certain data can produce errors you need to add the relevant code to avoid evaluating those expressions on those data. Yes, or would nice if PostgreSQL could do better here. The cost of doing so is quite high though, and there is no interest in incurring that cost. David J.