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