Attached is the patch set rebased on current master. I have split the patch into two parts: 0001 teaches eval_const_expressions to simplify COALESCE arguments using NOT NULL constraints, and 0002 teaches expr_is_nonnullable to handle COALESCE expressions.
In addition, 0003 is a WIP patch that extends expr_is_nonnullable to handle more expression types. I suspect there are additional cases beyond those covered in this patch that can be proven non-nullable. - Richard
v3-0001-Simplify-COALESCE-arguments-using-NOT-NULL-constr.patch
Description: Binary data
v3-0002-Teach-expr_is_nonnullable-to-handle-CoalesceExprs.patch
Description: Binary data
v3-0003-Teach-expr_is_nonnullable-to-handle-more-expressi.patch
Description: Binary data
