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-06-20 09:58:25
Message-ID: 20260620.185825.525530614716872063.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Henson,

> rest. So evaluating its DEFINE -- option (b) -- would mean running a clause
> the standard tells us to ignore.

Right.

> Agreed, and the parallel is convincing. An unused window already escapes
> the negative-frame-offset check, so singling out DEFINE as the one clause
> that must fire regardless would be inconsistent with how the rest of an
> unused window already behaves.
>
> This also matches the planner: select_active_windows() drops any window with
> no referencing WindowFunc, and its comment already cites the same <window
> clause> General Rules (General Rule 4) as its basis.
>
> Either way, the disregard rule governs only execution. A failure raised in
> the parser, transform, rewrite, or planner is a separate, static layer the
> rule does not touch. And at execution there is nothing to evaluate: an
> unused window is never turned into a WindowAgg node, so its DEFINE is never
> reached.

Yes, the rule only applies to execution. I think what we do in other
phases is implementation dependent.

> So I'm convinced -- let's keep (a), the current behavior, and I'll treat
> this open question as closed, with no patch change. For the record, the two
> halves stay cleanly separated: the RPR DEFINE volatility check still visits
> every window clause at preprocessing (independent of select_active_windows),
> while run-time DEFINE evaluation happens only for windows that survive it.
>
> Thanks for digging up the standard text.

You are welcome. Please feel free to ask me if you want to know what
9075-2 says about someting.

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-06-20 10:20:58 Re: Fix publisher-side sequence permission reporting
Previous Message Amit Kapila 2026-06-20 09:42:42 Re: Fix race in ReplicationSlotRelease for ephemeral slots