From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Leo Volin <lvolin(at)intelligentaudit(dot)com> |
Cc: | "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Case clause doesn't report syntactic error |
Date: | 2024-09-14 22:26:07 |
Message-ID: | CAKFQuwYMz9Ntog_UL-f2+A8YBvNWp3ZbRHYUWx5EkaiWz+ivRw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On Saturday, September 14, 2024, Leo Volin <lvolin(at)intelligentaudit(dot)com>
wrote:
>
> It doesn't match the documented format:
> CASE WHEN *condition* THEN *result*
> [WHEN ...]
> [ELSE *result*]
> END
> As long as the type of entry between CASE and first WHEN matches type of
> WHEN conditions no syntax error is being generated!
>
Read the entire section documenting case.
https://www.postgresql.org/docs/current/functions-conditional.html#FUNCTIONS-CASE
There are two forms documented - the general and then the “simple”
variant. You example demonstrates the later.
David J.
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2024-09-14 22:33:54 | Re: Case clause doesn't report syntactic error |
Previous Message | Leo Volin | 2024-09-14 21:27:35 | Case clause doesn't report syntactic error |