Re: returning multiple result sets from a stored procedure

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: returning multiple result sets from a stored procedure
Дата
Msg-id AANLkTi=FsdRAoj3uibfU34=d288fpmCBYNybK08h2dMJ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: returning multiple result sets from a stored procedure  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
2010/9/9 Robert Haas <robertmhaas@gmail.com>:
> On Thu, Sep 9, 2010 at 4:29 PM, Pavel Stehule <pavel.stehule@gmail.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
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: returning multiple result sets from a stored procedure
Следующее
От: Tom Lane
Дата:
Сообщение: Re: returning multiple result sets from a stored procedure