Re: Function Overloading - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Function Overloading
Date
Msg-id 23422.1527169951@sss.pgh.pa.us
Whole thread Raw
In response to Function Overloading  (ramsiddu007 <ramsiddu007@gmail.com>)
List pgsql-hackers
ramsiddu007 <ramsiddu007@gmail.com> writes:
>             I hope you are all doing good. Actually I got one problem. I
> have 2 functions like below. Those are having 11 and 14 parameters with
> commonly last parameter is variadic array type.

> func_get_item_list_phy_param(smallint, numeric, numeric, character varying,
> character varying, character varying, numeric, character varying, integer,
> integer, character varying[]);

> func_get_item_list_phy_param(smallint, numeric, numeric, character varying,
> character varying, character varying, numeric, character varying, integer,
> integer, character varying, character varying, character varying, character
> varying[]);

Don't do that.  There's no way for the system to figure out which one it
should call if you have >= 14 actual parameters, because they both match
the call equally well.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: A Japanese-unfriendy error message contruction
Next
From: Laurenz Albe
Date:
Subject: Locks on unlogged tables are locked?!