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.

-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Reply via email to