pgsql: Use ereport rather than elog in WinCheckAndInitializeNullTreatme

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use ereport rather than elog in WinCheckAndInitializeNullTreatme
Date: 2025-10-14 10:19:38
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use ereport rather than elog in WinCheckAndInitializeNullTreatment.

Previously WinCheckAndInitializeNullTreatment() used elog() to emit an
error message. ereport() should be used instead because it's a
user-facing error. Also use existing get_func_name() to get a
function's name, rather than own implementation.

Moreover add an assertion to validate winobj parameter, just like
other window function API.

Reported-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Author: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Reviewed-by: Chao Li <lic(at)highgo(dot)com>
Discussion: https://postgr.es/m/2952409.1760023154%40sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5f3808646f67260d5dc0d95f2602886da5cf5c52

Modified Files
--------------
src/backend/executor/nodeWindowAgg.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Melanie Plageman 2025-10-14 14:15:07 pgsql: Bump XLOG_PAGE_MAGIC after xl_heap_prune change
Previous Message Richard Guo 2025-10-14 07:37:26 pgsql: Rename apply_at to apply_agg_at for clarity