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