RE: Add Nullif case for eval_const_expressions_mutator

From: "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: Add Nullif case for eval_const_expressions_mutator
Date: 2021-01-12 04:58:34
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> > I notice that there are no Nullif case in eval_const_expression.
> > Since Nullif is similar to Opexpr and is easy to implement, I try add
> > this case in eval_const_expressions_mutator.
> I think this patch should be about a tenth the size. Try modeling it on
> the T_SubscriptingRef-etc case, ie, use ece_generic_processing and then
> ece_evaluate_expr to cover the generic cases. OpExpr is common enough to
> deserve specially optimized code, but NullIf isn't, so shorter is better.

Thanks for the review.

Attaching v2 patch , which followed the suggestion
to use ece_generic_processing and ece_evaluate_expr to simplify the code.

Please have a check.

Best regards,

Attachment Content-Type Size
v2-0001-add-nullif-case-for-eval_const_expressions.patch application/octet-stream 3.3 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2021-01-12 05:26:45 Re: Deleting older versions in unique indexes to avoid page splits
Previous Message japin 2021-01-12 04:27:49 Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION