Re: returning multiple result sets from a stored procedure

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: returning multiple result sets from a stored procedure
Дата
Msg-id AANLkTi=bsssdtJuy8=7m3Md6_nY2TdXt7UUUTU-1BMn=@mail.gmail.com
обсуждение исходный текст
Ответ на Re: returning multiple result sets from a stored procedure  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: returning multiple result sets from a stored procedure  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: returning multiple result sets from a stored procedure  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: returning multiple result sets from a stored procedure  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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 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 по дате отправления:

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