Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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


  • From: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
  • To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
  • 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: Mon, 17 Aug 2009 18:15:21 +0200
  • Message-id: <4A898219.9000506@netzmeister-st-pauli.de> <text/plain>

Alvaro Herrera schrieb:
"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>

Agreed ... using the standard terminology is better (as Tom also mentioned already).

Cheers

Andy



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group