Re: PL/pgSQL THEN binging in condition - Mailing list pgsql-bugs

From Tom Lane
Subject Re: PL/pgSQL THEN binging in condition
Date
Msg-id 1681151.1726603202@sss.pgh.pa.us
Whole thread Raw
In response to Re: PL/pgSQL THEN binging in condition  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #18618: pg_upgrade from 14 to 15+ fails for unlogged table with identity column
Next
From: Noah Misch
Date:
Subject: Re: Leader backend hang on IPC/ParallelFinish when LWLock held at parallel query start