Re: Add Nullif case for eval_const_expressions_mutator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add Nullif case for eval_const_expressions_mutator
Date: 2021-01-11 16:20:53
Message-ID: 883197.1610382053@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com> writes:
> 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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2021-01-11 16:27:30 Re: Moving other hex functions to /common
Previous Message David Fetter 2021-01-11 16:13:54 Re: popcount