Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-08 Thread Josh Berkus
Tom, I concur with the other comment that plpgql is intended to mimic Oracle PL/SQL, not SQL/PSM. If we try to follow two different leads we are likely to find ourselves with a mess. Well, the proposed functionality would be extremely useful in making PL/pgSQL a more robust language. So ca

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-08 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Pavel Stehule wrote: >> I looked into SQL2003, and SQL2003 knows it (SQL/PSM): >> >> ::= >> >> | >> ::= >> SET >> ::= >> [ { >> }... ] >> ::= >> SET > The parentheses are apparently required for multiple variables, so in > our case i

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-08 Thread Jonah H. Harris
On 8/8/06, Alvaro Herrera <[EMAIL PROTECTED]> wrote: Are we intending to support SQL/PSM with PL/pgSQL? I hope not. While PL/pgSQL and SQL/PSM share some similarities, they should be totally separate. IIRC, EnterpriseDB had tried to sponsor someone to write SQL/PSM support for PostgreSQL a li

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-08 Thread Alvaro Herrera
Andrew Dunstan wrote: > Pavel Stehule wrote: > >I looked into SQL2003, and SQL2003 knows it (SQL/PSM): > > [grammar productions] > > The parentheses are apparently required for multiple variables, so in > our case it might look like this: > > (a,b,c) := foo(bar); > > That might overcome the ob

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-08 Thread Andrew Dunstan
Pavel Stehule wrote: Tom Lane wrote: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> a,b,c := out3fce(1); -- Simultaneous assignment > > I thought we rejected that idea once already, on the grounds that it > would make it too hard to tell the difference between intended code > and typos. > In

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-08 Thread Pavel Stehule
Tom Lane wrote: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> a,b,c := out3fce(1); -- Simultaneous assignment > > I thought we rejected that idea once already, on the grounds that it > would make it too hard to tell the difference between intended code > and typos. > In any case, I had some

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-07 Thread Pavel Stehule
Martijn van Oosterhout writes: > Well, you can implement it. After all, the CALL syntax is merely > syntactic sugar. You could (if you wanted to) do the following: > CREATE FUNCTION foo( a TEXT IN, b TEXT INOUT, c TEXT OUT ) as blah... > And in a pl/pgsql function, translate: "CALL foo(a,b,c)"

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-07 Thread Tom Lane
Martijn van Oosterhout writes: > Well, you can implement it. After all, the CALL syntax is merely > syntactic sugar. You could (if you wanted to) do the following: > CREATE FUNCTION foo( a TEXT IN, b TEXT INOUT, c TEXT OUT ) as blah... > And in a pl/pgsql function, translate: "CALL foo(a,b,c)"

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-07 Thread Martijn van Oosterhout
On Mon, Aug 07, 2006 at 04:11:48PM +0200, Pavel Stehule wrote: > The best of is implementation of CALL statement, where I can transmit > values "by" references. But it's not possible in Postgres :-(. I can't to > select unambiguously called procedure. "I can, if I accept SQL Server > syntax, whe

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-07 Thread Pavel Stehule
Tom Lane wrote: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> a,b,c := out3fce(1); -- Simultaneous assignment > > I thought we rejected that idea once already, on the grounds that it > would make it too hard to tell the difference between intended code > and typos. > In any case, I had some q

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-07 Thread Pavel Stehule
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > a,b,c := out3fce(1); -- Simultaneous assignment I thought we rejected that idea once already, on the grounds that it would make it too hard to tell the difference between intended code and typos. Yes, because wasn't procedures with out params, my

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for

2006-08-07 Thread andrew
Tom Lane wrote: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> a,b,c := out3fce(1); -- Simultaneous assignment > > I thought we rejected that idea once already, on the grounds that it > would make it too hard to tell the difference between intended code > and typos. > In any case, I had some que

Re: [HACKERS] proposal for 8.3: Simultaneous assignment for PL/pgSQL

2006-08-07 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > a,b,c := out3fce(1); -- Simultaneous assignment I thought we rejected that idea once already, on the grounds that it would make it too hard to tell the difference between intended code and typos. regards, tom lane