Pavel Stehule <pavel.stehule@gmail.com> writes:
> út 17. 9. 2024 v 20:04 odesílatel PetSerAl <petseral@gmail.com> napsal:
>> It seems error here because first THEN bound to IF statement rather than
>> CASE expression.
> It is an interesting use case, but I am afraid it can be fixed (enhanced)
> without a strong rewrite of the plpgsql engine.
It would not be that hard to teach read_sql_construct to count nesting
of CASE ... END, as it already does for parentheses. However, I'm a
little worried whether that'd interact badly with plpgsql's own uses
of CASE and END.
regards, tom lane