Re: proposal for 8.3: Simultaneous assignment for PL/pgSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>, andrew(at)dunslane(dot)net, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal for 8.3: Simultaneous assignment for PL/pgSQL
Date: 2006-08-07 17:11:40
Message-ID: 2921.1154970700@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout <kleptog(at)svana(dot)org> 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)"
> into "(b,c) = foo(a,b)" internally.

No, Pavel's right: that doesn't work because it's ambiguous. How do you
tell whether "CALL foo(a,b,c)" means

a,b,c := foo();
b,c := foo(a);
c := foo(a,b);
select foo(a,b,c);

There could be functions foo matching all four interpretations.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua Reich 2006-08-07 17:12:43 Re: AOL Research open-research
Previous Message Jim C. Nasby 2006-08-07 17:05:47 Re: interesting article: Leverage your PostgreSQL V8.1 skills to learn DB2, Version