Re: COALESCE with single argument looks like identity function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Maksim Milyutin <maksim(dot)milyutin(at)tantorlabs(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: COALESCE with single argument looks like identity function
Date: 2025-07-03 21:45:42
Message-ID: 121284.1751579142@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Maksim Milyutin <maksim(dot)milyutin(at)tantorlabs(dot)ru> writes:
> Updated patchset is attached

Pushed with minor adjustments. Mainly, I didn't entirely trust
your substitutions of, eg, "COALESCE(q1)" to "COALESCE(q1, 0)".
That would produce a different result if q1 were NULL. I'm not
sure that that actually occurs in these regression tests, or
that it would affect the intent of the tests anyway. But we can
avoid having to think hard about that question by instead writing
"COALESCE(q1, q1)" and so on. That does provably give the same
result as before.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-07-04 00:06:16 Re: Changing shared_buffers without restart
Previous Message Tom Lane 2025-07-03 20:31:14 Re: Cross-type index comparison support in contrib/btree_gin