Re: returning multiple result sets from a stored procedure

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Robert Haas <robertmhaas(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:59:02
Message-ID: AANLkTi=FsdRAoj3uibfU34=d288fpmCBYNybK08h2dMJ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/9/9 Robert Haas <robertmhaas(at)gmail(dot)com>:
> 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 don't agree with you - this behave is because pg doesn't hold
dependency between functions and preparsed SQL - so this is one the
most simple protection. But if somebody appends a relations between
views and functions to dictionary, then he can rechecks necessary
views automatically.

Regards

Pavel Stehule

 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
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-09-09 20:59:28 Re: returning multiple result sets from a stored procedure
Previous Message Pavel Stehule 2010-09-09 20:53:05 Re: returning multiple result sets from a stored procedure