Re: wording for 38.6.2.4. Simple CASE and 38.6.2.5. Searched CASE

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-docs(at)postgresql(dot)org
Subject: Re: wording for 38.6.2.4. Simple CASE and 38.6.2.5. Searched CASE
Date: 2009-08-17 16:10:10
Message-ID: 20090817161010.GC4782@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Andreas Wenk wrote:
> Tom Lane wrote:
> >Hmm, it would be important to keep this in sync with the core-SQL
> >description of CASE, no? (Section 9.16.1)
>
> yes. And there is written "general" form and "simple" form. I like that.
>
> >I can't say that I think "simple CASE" and "searched CASE" are good
> >descriptions of the two forms, but just switching them doesn't make it
> >much better. And doing so would likely create as much confusion as
> >it eliminates. Can we come up with some other phrases?
>
> IMO it should be the same like in 9.16.1 - a "general" form and a
> "simple" form. Then changing both sections would be ok, because in
> 9.16.1 the simple form is mentioned after the general form.

"simple case" and "searched case" is SQL/PSM's terminology. I'm not
sure it's necessarily a good idea to deviate from that. See SQL part 4,
13.6 <case statement>:

Function
Provide conditional execution based on truth of <search condition>s or on equality of operands.

Format
<case statement> ::=
<simple case statement>
| <searched case statement>
<simple case statement> ::=
CASE <case operand>
<simple case statement when clause>...
[ <case statement else clause> ]
END CASE
<searched case statement> ::=
CASE <searched case statement when clause>...
[ <case statement else clause> ]
END CASE
<simple case statement when clause> ::=
WHEN <when operand list>
THEN <SQL statement list>
<searched case statement when clause> ::=
WHEN <search condition>
THEN <SQL statement list>
<case statement else clause> ::= ELSE <SQL statement list>

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Andreas Wenk 2009-08-17 16:15:21 Re: wording for 38.6.2.4. Simple CASE and 38.6.2.5. Searched CASE
Previous Message Andreas Wenk 2009-08-17 10:10:29 Re: wording for 38.6.2.4. Simple CASE and 38.6.2.5. Searched CASE