On 03/04/2008, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Pavel Stehule" <pavel.stehule@gmail.com> writes:
> >> What exactly are you trying to accomplish?
>
> > when I build CASE expression, I have to merge some PLpgSQL_expr
> > together. Then I have to reparse expr->query and I have to find params
> > and actualize it.
>
> There has to be a better way than that. What CASE syntax are you
> trying to implement, anyhow?
CASE expr
WHEN expr [,expr[,...]] THEN
statements list
END CASE;
CASE
WHEN expr THEN
statements list
WHEN ....
END CASE;
I would to remove repeated evaluation and casting. Transformation to
SQL case statement is simply and fast. I had to add one file to
plpgsql code, but I haven't any redundant code and code is readable
and simple. But any ideas are welcome.
Current patch is in attachment
>
> regards, tom lane
>