Re: Function with default value not replacing old definition of the function

From: "Rushabh Lathia" <rushabh(dot)lathia(at)gmail(dot)com>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, rushabh(dot)lathia(at)enterprisedb(dot)com
Subject: Re: Function with default value not replacing old definition of the function
Date: 2008-12-11 07:37:32
Message-ID: 460abcb10812102337se6477afxbd0719e35c51880f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 11, 2008 at 12:59 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>wrote:

> 2008/12/11 Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>:
> >
> >
> > On Thu, Dec 11, 2008 at 12:40 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com
> >
> > wrote:
> >>
> >> Hello
> >>
> >>
> >> when you created function, we cannot check defaults, because we don't
> >> know if anybody use default or not. And when you call function, then
> >> postgres prefer function with most similar function.
> >
> > Ok, but what if I want to call a second function with the default values.
> > How can I call that function with default values?
> >
>
> it isn't possible yet (without DEFAULT keyword support).

Ohh Ok.

Thanks

>
> you have to drop myfunc(int) first.
>
> regards
> Pavel Stehule
>
> >>
> >>
> >> regards
> >> Pavel Stehule
> >>
> >> >
> >> > When create the same function again by added one default value, while
> >> > calling the function old function getting called.
> >> >
> >> > It seems that, function with defval not making any sense, if we want
> to
> >> > call
> >> > the new function then we need to pass defval as well.
> >> >
> >> > select myfunc(10,10);
> >> >
> >> > myfunc
> >> > ----------
> >> > 200
> >> > (1 row)
> >> >
> >> > I think second function should replace the old definition of the
> >> > function,
> >> > inputs ?
> >> >
> >> >
> >> > Thanks,
> >> > Rushabh Lathia
> >> > www.EnterpriseDB.com
> >> >
> >
> >
> >
> > --
> > Rushabh Lathia
> > www.EnterpriseDB.com
> >
>

--
Rushabh Lathia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-12-11 07:44:15 Re: Sync Rep: First Thoughts on Code
Previous Message Peter Eisentraut 2008-12-11 07:34:09 pgsql: Append major version number and for libraries soname major