Re: Row pattern recognition

From: Henson Choi <assam258(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>, Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: zsolt(dot)parragi(at)percona(dot)com, sjjang112233(at)gmail(dot)com, 신성준 <shinsj4653(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-08-28 00:12:17
Message-ID: CAAAe_zA95PJJinYGfHaeT7-vpE-G+vUcsj3r=195teZK+kpAOQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi jian,

> The comments in preprocess_expression says we shouldn't
> selectively skip constant folding for particular node fields

Agreed, and that convinces me my direction was wrong. I withdraw the
suggestion of running the pass over the argument with evaluation turned
off; nothing in eval_const_expressions() needs to change -- not a skip,
not an evaluation-off pass, not the case itself.

The reason I no longer think the case should just error is that v / 0
cannot fold on its own -- the parser requires a column reference of
every navigation argument, so int4div keeps a Var -- and it becomes
foldable only because pull_up_simple_values() has already replaced v
with Const 10, in pullup_replace_vars_callback(). So the question looks
like the substitution rather than the fold.

Best regards,
Henson

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2026-08-28 00:17:00 Re: Introduce XID age based replication slot invalidation
Previous Message Noah Misch 2026-08-27 23:17:57 64-bit MultiXactOffset vs. 9.3->9.4 upgrade, pg_resetwal, "wraparound" msg