| From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
|---|---|
| To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
| Cc: | Darren Duncan <darren(at)darrenduncan(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: returning multiple result sets from a stored procedure |
| Date: | 2010-09-09 20:46:49 |
| Message-ID: | AANLkTi=bsssdtJuy8=7m3Md6_nY2TdXt7UUUTU-1BMn=@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Sep 9, 2010 at 4:29 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>>> so I can to write
>>>
>>> CREATE PROCEDURE foo(OUT a int)
>>> ...
>>>
>>> and
>>> CREATE PROCEDURE foo(OUT a varchar)
>>> ...
>>>
>>> and then when I use a statement CALL is correct procedure selected
>>>
>>> CALL foo(textvariable)
>>
>> That seems like a lot of complexity for no real benefit, to me.
>
> no, you can to specify a expected result type - it's very for some
> convert or import functions. So we expect so out procedures will
> supports to OUT parameters, then implementation of this mechanism has
> minimal overhead to current implementation. Just to add types of OUT
> parameters to searching algorithm.
>
> More - it is just consistent with overloading idea. Why the OUT
> parameters should be removed from procedure parameters?
I think the question is whether there's something broken enough about
the current system to warrant doing something different, and I guess
my answer would be no. To be honest, I am already pretty unhappy with
the changes that make it impossible to redefined foo(a int) as
foo(anteater int), which is a perfectly reasonable thing to want to do
but which is now forbidden because someone MIGHT have called the
function as foo(a := 3), and I certainly don't want to make it any
worse. Whether there are actually any stored queries that call the
function this way (or at all) is doesn't matter: it's not allowed. So
for a marginal notational convenience we have created dependency hell,
where you must drop and recreate every dependent object to perform a
trivial renaming. I think this is really quite horrible and would
have argued against accepting this patch at the time if I'd realized
what effect it was going to have.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Pavel Stehule | 2010-09-09 20:53:05 | Re: returning multiple result sets from a stored procedure |
| Previous Message | Pavel Stehule | 2010-09-09 20:44:18 | Re: returning multiple result sets from a stored procedure |