Re: ANSI SQL, CASE expression Conformance F262, F263 any info

From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ANSI SQL, CASE expression Conformance F262, F263 any info
Date: 2005-12-15 07:41:13
Message-ID: BAY20-F146B9BD5A448F02383684CF93B0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>"Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com> writes:
> > I can't find any information of syntax for ANSI Conformance F262, F263.
>Has
> > somebody any information about this points: Extended CASE expression,
>comma
> > separated predicates in simple case expression
>
>There are no such feature IDs listed in either SQL99 or SQL2003. What
>are you reading?
>
> regards, tom lane

First, I looked
http://www.postgresql.org/docs/8.1/interactive/unsupported-features-sql-standard.html

I don't found any information on internet - only BNF syntax for SQL 2003.
http://savage.net.au/SQL/sql-2003-2.bnf.html#xref-CASE

SQL2003 has little bit different syntax for CASE.

example: BETWEEN
<between> := <row value> between_part2
<between_part2> := [NOT] BETWEEN [ASYMMETRIC|SYMMETRIC] <row value> AND <row
value>
---------------------------
<simple_case> := CASE <row value> <simple_when_clause> [<else_clause>] END
<simple_when_clause := WHEN <when_operand> THEN <result>
<when_operand> := <row value> | <between_part2> | ....

so I can:
SELECT
CASE EXTRACT(minute FROM when_col)
WHEN BETWEEN 0 AND 14 THEN 0
WHEN BETWEEN 15 AND 29 THEN 15
WHEN BETWEEN 30 AND 44 THEN 30
ELSE 45
END

this is extended CASE expression propably F262. About F263 I don't found any
indicies. Maybe it's
SELECT CASE col
WHEN 1,3,5,7,9,11 THEN false
ELSE END

I looked into parser. F262 is usefull, but I am not sure if can be
implemented. It's need refactoring gram.y or duplicate code for CASE, and
maybe others - is possible share one operand in more expressions?

I see others ANSI or NON ANSI enhancing as much usefull: window function or
autonomous transaction.

Regards
Pavel Stehule

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2005-12-15 07:42:52 Re: 7.3 failure on platypus
Previous Message Mark Kirkwood 2005-12-15 07:14:27 Re: 7.3 failure on platypus