Function with default value not replacing old definition of the function - Mailing list pgsql-hackers

From Rushabh Lathia
Subject Function with default value not replacing old definition of the function
Date
Msg-id 460abcb10812102245n34f05579ree156c9e6b26edde@mail.gmail.com
Whole thread Raw
Responses Re: Function with default value not replacing old definition of the function
Re: Function with default value not replacing old definition of the function
List pgsql-hackers
Hi,<br /><br />Testcase: (8.4 CVS head)<br />====================<br /><br />CREATE OR REPLACE FUNCTION myfunc(y
int)<br/>RETURNS INTEGER AS $$<br />   select  100;<br />$$ language sql;<br /><br />CREATE OR REPLACE FUNCTION
myfunc(yint, x integer DEFAULT 100)<br /> RETURNS INTEGER AS $$<br />   select  200;<br />$$ language sql;<br /><br
/>selectmyfunc(10);<br /><br /> myfunc<br />----------<br />      100<br />(1 row) <br /><br />When create the same
functionagain by added one default value, while calling the function old function getting called. <br /><br />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.<br/><br />select myfunc(10,10);<br /><br /> myfunc<br /> ----------<br />       200<br /> (1 row) <br /><br />I
thinksecond function should replace the old definition of the function, inputs ?<br /><br /><br />Thanks,<br />Rushabh
Lathia<br/><a href="http://www.EnterpriseDB.com">www.EnterpriseDB.com</a><br /> 

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Multiplexing SUGUSR1
Next
From: Peter Eisentraut
Date:
Subject: Re: Function with default value not replacing old definition of the function