Re: Row pattern recognition

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: assam258(at)gmail(dot)com
Cc: jian(dot)universality(at)gmail(dot)com, zsolt(dot)parragi(at)percona(dot)com, sjjang112233(at)gmail(dot)com, vik(at)postgresfriends(dot)org, er(at)xs4all(dot)nl, jacob(dot)champion(at)enterprisedb(dot)com, david(dot)g(dot)johnston(at)gmail(dot)com, peter(at)eisentraut(dot)org, li(dot)evan(dot)chao(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Row pattern recognition
Date: 2026-11-25 10:00:27
Message-ID: 20261125.190027.404766072094049598.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Henson,

>> With v55 I don't see the error?
>
> Right, v55 returns 0. As section 1 says under "How it has been
> handled so far", v54 and v55 wrap what pull-up, join alias expansion
> and virtual generated column expansion put in, in a PlaceHolderVar,
> so this example and a, b and c return 0. The example shows the
> problem without that wrapping.
>
> But the wrapping fixes it the wrong way. When a join alias is
> expanded below its join level, as in the JOIN USING example in the
> same section, the backend crashes, and other shapes fail with
> internal errors. So the wrapping has to go either way, and that
> leaves two ways:
>
> 1. Remove the wrapping and accept the division by zero at plan
> time.
> 2. Remove the wrapping and go with the other fix in section 3,
> folding in two passes.
>
> Section 2 of my last mail asked you to choose between these two.
> Which would you prefer, or do you see a better way?

Ok, so the case is the division by zero in the constant folding at the
planning time. If that is the only case, I would consider working
hard for #2 not worth the trouble. I prefer #1 and we should write it
as a limitation of the patch so that we don't forget about it.

Regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2026-11-25 10:19:33 Re: unidirectional logical replication logging issue
Previous Message Xuneng Zhou 2026-11-25 09:46:56 Re: remove unused shared WAL flush request