proposal for 8.4: PL/pgSQL - statement CASE

Lists: pgsql-hackers
From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Pgsql Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 15:01:18
Message-ID: 162867790801170701q69d5a3b6h58a0a9a8c624dd8f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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

Implementation:
This statement is implemented in PL/pgPSM, so implementation will be
backported to PL/pgSQL.

Any ideas?

Regards
Pavel Stehule


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 15:49:17
Message-ID: 200801170749.17802.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:03:03
Message-ID: 478F7C37.6040205@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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 them, I believe.

You might find that a CASE statement does a little less than you expect,
though, if like the rest of PL/pgSQL it follows Ada rules.

cheers

andrew


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:06:12
Message-ID: 478F7CF4.3040404@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:11:42
Message-ID: 478F7E3E.3030004@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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 SWITCH instead?
>
>

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.

cheers

andrew


From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:18:56
Message-ID: 1200586736.4255.203.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.

We don't want things just because Oracle has them, we want them for a
real reason. If say, you had a migration project that would be made
easier by that feature, or there was clear benefit in improving the
language through the addition of a feature, maybe. If not, we must try
to do something better than everybody else, not just the same, unless
its an official standard.

I'd be interested in hearing about how SQL/PSM is going. What are your
plans for that?

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com


From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:19:12
Message-ID: 162867790801170819s588c25cfl2653fc8036bf8111@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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
solves statements, not expressions.

> I'd love to have CASE in PL/pgSQL, but I always thought that stood in the way.
>

it's safe. SQL/PSM use it too.

Pavel


From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Josh Berkus" <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:21:55
Message-ID: 162867790801170821l740c4506n132581f2b95a9d96@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 17/01/2008, Joshua D. Drake <jd(at)commandprompt(dot)com> 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 SWITCH instead?
>
I unlike it. There isn't reason why don't implement ANSI SQL standard construct.

Pavel

> Joshua D. Drake
>


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:37:55
Message-ID: 20080117083755.1da39af0@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 17 Jan 2008 11:11:42 -0500
Andrew Dunstan <andrew(at)dunslane(dot)net> 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 PostgreSQL.

Sincerely,

Joshua D. Drake

- --
The PostgreSQL Company: Since 1997, http://www.commandprompt.com/
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHj4RlATb/zqfZUUQRAmidAKCsRmGkQezCs+KqXOQ860V9g4jDnwCgkIKS
9qdY+ULKlRMucvxideWzjQE=
=REm+
-----END PGP SIGNATURE-----


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:38:41
Message-ID: 20080117083841.2015cba6@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 17 Jan 2008 16:18:56 +0000
Simon Riggs <simon(at)2ndquadrant(dot)com> 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 too.
>
> Please don't post links to potentially copyrighted works.

Simon, this email is copyrighted... ;)

>
> We don't want things just because Oracle has them, we want them for a
> real reason. If say, you had a migration project that would be made
> easier by that feature, or there was clear benefit in improving the
> language through the addition of a feature, maybe. If not, we must try
> to do something better than everybody else, not just the same, unless
> its an official standard.

Exactly.

>
> I'd be interested in hearing about how SQL/PSM is going. What are your
> plans for that?
>

That is certainly more interesting to me as well.

Sincerely,

Joshua D. Drake

- --
The PostgreSQL Company: Since 1997, http://www.commandprompt.com/
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHj4SRATb/zqfZUUQRAudoAJ0aw+35NlV9DLy1wwBRtlehMkw+BQCfbYJj
LtbfdSnbIEPiMBFnCgXEFW4=
=+Y+Y
-----END PGP SIGNATURE-----


From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: "Pgsql Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:39:23
Message-ID: 162867790801170839u77ac0050p6a0d3a6aa4f4658@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 17/01/2008, Simon Riggs <simon(at)2ndquadrant(dot)com> 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 too.
>
> Please don't post links to potentially copyrighted works.

I am sorry.
correct link http://www.pgsql.cz/index.php/Condition_statements
>
> We don't want things just because Oracle has them, we want them for a
> real reason. If say, you had a migration project that would be made
> easier by that feature, or there was clear benefit in improving the
> language through the addition of a feature, maybe. If not, we must try
> to do something better than everybody else, not just the same, unless
> its an official standard.

I understand well. But I would to respect similarity with PL/SQL. I
don't see reason for new special language for stored procedures that
is available only on PostgreSQL. And in this case Oracle PL/SQL CASE
statement is implementation of SQL/PSM CASE statement. Still SQL/PSM
isn't main language in PostgreSQL and isn't reason for fixation
plpgsql.

>
> I'd be interested in hearing about how SQL/PSM is going. What are your
> plans for that?
>

I prepare rpm and sources for 8.3 available from my archive and from
Devrim repository. There still some unsupported points - PostgreSQL
doesn't support all OOP features and some but not important things
depend on it (but I am not able to implement 100% clean SQL/PSM). And
than I will wait. Queue is full and I see lot of things with higher
priority than is SQL/PSM. I would to see real stored procedures in
8.4, but I don't belive.

Pavel

> --
> Simon Riggs
> 2ndQuadrant http://www.2ndQuadrant.com
>
>


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:40:51
Message-ID: 478F8513.7080608@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Joshua D. Drake wrote:
> On Thu, 17 Jan 2008 11:11:42 -0500
> Andrew Dunstan <andrew(at)dunslane(dot)net> 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 PostgreSQL.
>
>

Certainly. But that doesn't mean we should wantonly introduce
incompatibilities with PL/SQL. We have in the past rejected syntax
changes which would have done so - this would hardly be the first time.

In any case, as Pavel points out, Josh's original suggestion that there
would be some ambiguity is wrong, so the discussion seems to me to be moot.

cheers

andrew


From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Josh Berkus" <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:43:45
Message-ID: 162867790801170843r3ec4b6d4qc9584e861cb281a6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>
> 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 little bit incompatible.

Pavel

> Sincerely,
>
> Joshua D. Drake
>


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Josh Berkus" <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 16:54:43
Message-ID: 20080117085443.6e5fe53d@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 17 Jan 2008 17:43:45 +0100
"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> 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 different syntax, I don't understand. It's like
> Microsoft. Lot of things are little bit incompatible.

O.k. hold on guys. I really don't care what you do with plpgsql. I
don't use it unless I absolutely have to anyway. All I was doing was
saying that:

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.

Please continue on.

Sincerely,

Joshua D. Drake

- --
The PostgreSQL Company: Since 1997, http://www.commandprompt.com/
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHj4hVATb/zqfZUUQRAhbpAJ9+qwBAHqxwSCCeVzbRjKBiFTpVhQCdEX+j
vrXiUgBeLQoBKx3s68214qw=
=kc7c
-----END PGP SIGNATURE-----


From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Josh Berkus" <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 17:00:21
Message-ID: 162867790801170900v6eb012a0vf9e23f807fa89007@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>
> 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 (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). But why artificially create bigger dif between PL/pgSQL
and PL/SQL?

I am sorry, I can't to speak in English gently (because my English is
all else than English), and some my notes are maybe too much hard.

Pavel

> Please continue on.
>
> Sincerely,
>
> Joshua D. Drake
>
> - --
> The PostgreSQL Company: Since 1997, http://www.commandprompt.com/
> Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
> Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
> SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFHj4hVATb/zqfZUUQRAhbpAJ9+qwBAHqxwSCCeVzbRjKBiFTpVhQCdEX+j
> vrXiUgBeLQoBKx3s68214qw=
> =kc7c
> -----END PGP SIGNATURE-----
>


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Josh Berkus" <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 17:08:45
Message-ID: 20080117090845.1284ab3b@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 17 Jan 2008 18:00:21 +0100
"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> 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). But why artificially create bigger dif between PL/pgSQL
> and PL/SQL?
>
> I am sorry, I can't to speak in English gently (because my English is
> all else than English), and some my notes are maybe too much hard.

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)

Sincerely,

Joshua D. Drake


- --
The PostgreSQL Company: Since 1997, http://www.commandprompt.com/
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHj4udATb/zqfZUUQRAgyeAJ9Cb9pAMiWvP/JDv6F89JPBAh2IPACeI6a6
0yl+dXdE9XyCEoGNCeb9EXw=
=oHVb
-----END PGP SIGNATURE-----


From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Josh Berkus" <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 17:11:29
Message-ID: b42b73150801170911n6a3ee224n2ceaf9cdbe219bd7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Jan 17, 2008 12:08 PM, Joshua D. Drake <jd(at)commandprompt(dot)com> 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). But why artificially create bigger dif between PL/pgSQL
> > and PL/SQL?
> >
> > I am sorry, I can't to speak in English gently (because my English is
> > all else than English), and some my notes are maybe too much hard.
>
> 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)

ANSI SQL conformance is not necessarily the only goal. Being able to
easily port Oracle applications is pretty nice. Being able to run
T-SQL in some fashion would be nice as well.

merlin


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 17:44:41
Message-ID: 200801171744.m0HHif803111@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Joshua D. Drake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Thu, 17 Jan 2008 17:43:45 +0100
> "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> 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 different syntax, I don't understand. It's like
> > Microsoft. Lot of things are little bit incompatible.
>
> O.k. hold on guys. I really don't care what you do with plpgsql. I
> don't use it unless I absolutely have to anyway. All I was doing was
> saying that:
>
> A. I could give flying donkey butt about being the Oracle-Compatible
> community.

Well, our standard process is to check the ANSI syntax and if the
feature we want isn't mentioned we look at how Oracle or other databases
do it for ideas. I don't see why that should change.

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 as a project we do, at least in helping people
migrate to Postgres from other databases.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 17:59:02
Message-ID: 20080117095902.4ef5ae2f@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 17 Jan 2008 12:44:41 -0500 (EST)
Bruce Momjian <bruce(at)momjian(dot)us> 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 as a project we do, at least in helping people
> migrate to Postgres from other databases.
>

This appears to be the, "can't follow written points day". Magnus has
already given up on a thread on advocacy. I give up here.

Joshua D. Drake

- --
The PostgreSQL Company: Since 1997, http://www.commandprompt.com/
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHj5dmATb/zqfZUUQRAgtDAJ9H8igJII+kyAxarEFwtPMhe3GG+ACeLOjq
p9MZzOrDM2z3nDGw2H2c1Og=
=UnFv
-----END PGP SIGNATURE-----


From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Josh Berkus" <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 19:15:28
Message-ID: 162867790801171115g430f5035x562b698fc7327eb7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> 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 - some cases like this is different (it's 2days
work).

Pavel


From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 19:41:37
Message-ID: 37ed240d0801171141i7da3936o798a511b951bc689@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Jan 18, 2008 3:19 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> 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
> worlds. SELECT CASE is invisible for pl parser, because pl parser
> solves statements, not expressions.
>

Sounds good. Chaining ELSIFs is ugly; I've wished for something like
this in PL/pgSQL from time to time while writing my functions.

A hearty "+1" from me. Let me know if there's anything I can do to
help move it forward.

Cheers
BJ


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-01-17 20:13:24
Message-ID: 200801171213.25835.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel,

Speaking as someone who does lots of PL/pgSQL, CASE would be *great*.
Especially for triggers.

--
--Josh

Josh Berkus
PostgreSQL @ Sun
San Francisco


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal for 8.4: PL/pgSQL - statement CASE
Date: 2008-03-28 03:30:07
Message-ID: 200803280330.m2S3U7227030@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


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 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
>
> Implementation:
> This statement is implemented in PL/pgPSM, so implementation will be
> backported to PL/pgSQL.
>
> Any ideas?
>
> Regards
> Pavel Stehule
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +