Re: PL/pgSQL THEN binging in condition

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PetSerAl <petseral(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: PL/pgSQL THEN binging in condition
Date: 2024-09-17 20:00:02
Message-ID: 1681151.1726603202@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> út 17. 9. 2024 v 20:04 odesílatel PetSerAl <petseral(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Justin Pryzby 2024-09-17 23:47:11 Re: BUG #18545: \dt breaks transaction, calling error when executed in SET SESSION AUTHORIZATION
Previous Message Tom Lane 2024-09-17 19:56:13 Re: BUG #18618: pg_upgrade from 14 to 15+ fails for unlogged table with identity column