Re: Some optimizations for COALESCE expressions during constant folding

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Some optimizations for COALESCE expressions during constant folding
Date: 2025-11-25 12:59:07
Message-ID: 87h5ui6zfo.fsf@wibble.ilmari.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Richard Guo <guofenglinux(at)gmail(dot)com> writes:

> + ListCell *lc;
> +
> + foreach(lc, coalesceexpr->args)
> + {
> + Node *coalescearg = (Node *) lfirst(lc);

I have no comment on the rest of the patch, but this could be simplifed
using the foreach_ptr macro:

foreach_ptr(Node, coalescearg, coalesceexpr->args)
{

- ilmari

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2025-11-25 13:10:45 Re: Some optimizations for COALESCE expressions during constant folding
Previous Message torikoshia 2025-11-25 12:43:46 Re: RFC: Logging plan of the running query