Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-03-27 Thread Bruce Momjian
Added to TODO: o Add CASE capability to language (already in SQL) http://archives.postgresql.org/pgsql-hackers/2008-01/msg00696.php --- Pavel Stehule wrote: > Hello > > I found so PL/SQL support CASE st

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Josh Berkus
Pavel, Speaking as someone who does lots of PL/pgSQL, CASE would be *great*. Especially for triggers. -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropr

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Brendan Jurd
On Jan 18, 2008 3:19 AM, Pavel Stehule <[EMAIL PROTECTED]> wrote: > > Isn't there a danger of syntactical conflict with the SQL SELECT ... CASE > > statement? > > no, isn't. SELECT CASE can be only in expression .. inside SQL > statement, but PL/SQL CASE is PL statement. These are two different > w

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Pavel Stehule
> If primary goal is ANSI SQL conformance shouldn't we be focusing on > pl/psm not plpgsql? (yes I am aware they are similar syntatically) I am not sure if in 8.4 will be space for changes in PL interprets. I expect so plpgsql will be main SQL language next two years. I don't plan any big changes

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 17 Jan 2008 12:44:41 -0500 (EST) Bruce Momjian <[EMAIL PROTECTED]> wrote: > pl/PgSQL already is aimed at being Oracle compatible so why complain > that the author wants to use Oracle syntax if possible. If you don't > care, that is fine, but

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Bruce Momjian
Joshua D. Drake wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Thu, 17 Jan 2008 17:43:45 +0100 > "Pavel Stehule" <[EMAIL PROTECTED]> wrote: > > > we develop PostgreSQL, but why create own syntax for all? Why? Only so > > we develop PostgreSQL? We have different implementation and

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Merlin Moncure
On Jan 17, 2008 12:08 PM, Joshua D. Drake <[EMAIL PROTECTED]> wrote: > > Primary goal is ANSI SQL conformance (for me). Current PL/pgSQL isn't > > compatible and it will not be compatible in future (we have different > > implementation of SRF and really specific implementation of OUT > > parameters

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 17 Jan 2008 18:00:21 +0100 "Pavel Stehule" <[EMAIL PROTECTED]> wrote: > Primary goal is ANSI SQL conformance (for me). Current PL/pgSQL isn't > compatible and it will not be compatible in future (we have different > implementation of SRF and r

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Pavel Stehule
> > A. I could give flying donkey butt about being the Oracle-Compatible > community. > > B. That "SWITCH" may be an alternate syntax because 15 years ago when I > took a CS class and I did one chapter of C they had a SWITCH statement > that resembles CASE. > Primary goal is ANSI SQL conformance (

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 17 Jan 2008 17:43:45 +0100 "Pavel Stehule" <[EMAIL PROTECTED]> wrote: > we develop PostgreSQL, but why create own syntax for all? Why? Only so > we develop PostgreSQL? We have different implementation and different > limit, but why create diff

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Pavel Stehule
> > I'm sorry I thought we were developing PostgreSQL. > we develop PostgreSQL, but why create own syntax for all? Why? Only so we develop PostgreSQL? We have different implementation and different limit, but why create different syntax, I don't understand. It's like Microsoft. Lot of things are l

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Andrew Dunstan
Joshua D. Drake wrote: On Thu, 17 Jan 2008 11:11:42 -0500 Andrew Dunstan <[EMAIL PROTECTED]> wrote: That would surely defeat the whole point of having this. We want to have the same syntax as PL/SQL, not different syntax for the same things. I'm sorry I thought we were developing Po

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Pavel Stehule
On 17/01/2008, Simon Riggs <[EMAIL PROTECTED]> wrote: > On Thu, 2008-01-17 at 16:01 +0100, Pavel Stehule wrote: > > > I found so PL/SQL support CASE statement > > http://download-east.oracle.com/docs/cd/B10500_01/appdev.920/a96624/04_struc.htm#484 > > > > I propose add this statement to PL/pgSQL to

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 17 Jan 2008 16:18:56 + Simon Riggs <[EMAIL PROTECTED]> wrote: > On Thu, 2008-01-17 at 16:01 +0100, Pavel Stehule wrote: > > > I found so PL/SQL support CASE statement > > http://download-east.oracle.com/docs/cd/B10500_01/appdev.920/a96624

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 17 Jan 2008 11:11:42 -0500 Andrew Dunstan <[EMAIL PROTECTED]> wrote: > > That would surely defeat the whole point of having this. We want to > have the same syntax as PL/SQL, not different syntax for the same > things. I'm sorry I thought we

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Pavel Stehule
On 17/01/2008, Joshua D. Drake <[EMAIL PROTECTED]> wrote: > Josh Berkus wrote: > > Pavel, > > > >> I propose add this statement to PL/pgSQL too. > > > > Isn't there a danger of syntactical conflict with the SQL SELECT ... CASE > > statement? > > > > I'd love to have CASE in PL/pgSQL, but I always t

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Pavel Stehule
Hello > > Isn't there a danger of syntactical conflict with the SQL SELECT ... CASE > statement? > no, isn't. SELECT CASE can be only in expression .. inside SQL statement, but PL/SQL CASE is PL statement. These are two different worlds. SELECT CASE is invisible for pl parser, because pl parser s

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Simon Riggs
On Thu, 2008-01-17 at 16:01 +0100, Pavel Stehule wrote: > I found so PL/SQL support CASE statement > http://download-east.oracle.com/docs/cd/B10500_01/appdev.920/a96624/04_struc.htm#484 > > I propose add this statement to PL/pgSQL too. Please don't post links to potentially copyrighted works. W

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Andrew Dunstan
Joshua D. Drake wrote: Josh Berkus wrote: Pavel, I propose add this statement to PL/pgSQL too. Isn't there a danger of syntactical conflict with the SQL SELECT ... CASE statement? I'd love to have CASE in PL/pgSQL, but I always thought that stood in the way. Could it be called SWIT

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Joshua D. Drake
Josh Berkus wrote: Pavel, I propose add this statement to PL/pgSQL too. Isn't there a danger of syntactical conflict with the SQL SELECT ... CASE statement? I'd love to have CASE in PL/pgSQL, but I always thought that stood in the way. Could it be called SWITCH instead? Joshua D. Drake

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Andrew Dunstan
Josh Berkus wrote: Pavel, I propose add this statement to PL/pgSQL too. Isn't there a danger of syntactical conflict with the SQL SELECT ... CASE statement? I'd love to have CASE in PL/pgSQL, but I always thought that stood in the way. It should be possible to disambiguate t

Re: [HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Josh Berkus
Pavel, > I propose add this statement to PL/pgSQL too. Isn't there a danger of syntactical conflict with the SQL SELECT ... CASE statement? I'd love to have CASE in PL/pgSQL, but I always thought that stood in the way. -- Josh Berkus PostgreSQL @ Sun San Francisco ---

[HACKERS] proposal for 8.4: PL/pgSQL - statement CASE

2008-01-17 Thread Pavel Stehule
Hello I found so PL/SQL support CASE statement http://download-east.oracle.com/docs/cd/B10500_01/appdev.920/a96624/04_struc.htm#484 I propose add this statement to PL/pgSQL too. Reasons: a) it's useful construct, b) this statement is defined in SQL/PSM - better conformance with ANSI Implementa