Re: Question about FUNCDETAIL_MULTIPLE

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Question about FUNCDETAIL_MULTIPLE
Дата
Msg-id 162867790906040542v64ae9c43j56578dfad9a16cd7@mail.gmail.com
обсуждение исходный текст
Ответ на Question about FUNCDETAIL_MULTIPLE  (Gevik Babakhani <pgdev@xs4all.nl>)
Список pgsql-hackers
2009/6/4 Gevik Babakhani <pgdev@xs4all.nl>:
> 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?
>

This is +/- for historical reasons. We used original algorithm for
ambiguous function identification.

regards
Pavel Stehule

>
> 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
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: pg@thetdh.com
Дата:
Сообщение: Re: Improving the ngettext() patch
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: It's June 1; do you know where your release is?