Question about FUNCDETAIL_MULTIPLE - Mailing list pgsql-hackers

From Gevik Babakhani
Subject Question about FUNCDETAIL_MULTIPLE
Date
Msg-id 4A278F12.2040805@xs4all.nl
Whole thread Raw
Responses Re: Question about FUNCDETAIL_MULTIPLE  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Question about FUNCDETAIL_MULTIPLE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I was wondering what the philosophy is behind letting an "ambiguous" 
function be created in the first place. Is this for backwards 
compatibility or perhaps for historical reasons? Could someone clarify 
this please?


Consider the following example:

(
FYI:
parse_func.c->ParseFuncOrColumn->164
parse_func.c->ParseFuncOrColumn->810
parse_func.c->ParseFuncOrColumn->836
namespace.c->FuncnameGetCandidates->607
namespace.c->FuncnameGetCandidates->826
parse_func.c->ParseFuncOrColumn->224
)


-----------------------------------------------------------------------------
create or replace function foo1(int,int default 1,int default 2) returns 
int as
$$    select $1+$2+$3
$$
language sql;


create or replace function foo1(int,int default 1) returns int as
$$    select $1+$2
$$
language sql;


select * from foo1(10,10)

ERROR:  function foo1(integer, integer) is not unique
LINE 15: select * from foo1(10,10)                       ^
HINT:  Could not choose a best candidate function. You might need to add 
explicit type casts.
-----------------------------------------------------------------------------

-- 
Regards,
Gevik


pgsql-hackers by date:

Previous
From: "Markus Wanner"
Date:
Subject: Re: PostgreSQL Developer meeting minutes up
Next
From: "Markus Wanner"
Date:
Subject: Re: PostgreSQL Developer meeting minutes up