Re: Question about FUNCDETAIL_MULTIPLE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about FUNCDETAIL_MULTIPLE
Дата
Msg-id 12964.1244123565@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Question about FUNCDETAIL_MULTIPLE  (Gevik Babakhani <pgdev@xs4all.nl>)
Ответы Re: Question about FUNCDETAIL_MULTIPLE  (Gevik Babakhani <pgdev@xs4all.nl>)
Список pgsql-hackers
Gevik Babakhani <pgdev@xs4all.nl> writes:
> 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?

Neither; it's a feature, and one we quite like.  For example, would you
really prefer that the six different versions of abs() had to have
different names?

regression=# \df abs                         List of functions  Schema   | Name | Result data type | Argument data
types|  Type  
 
------------+------+------------------+---------------------+--------pg_catalog | abs  | bigint           | bigint
       | normalpg_catalog | abs  | double precision | double precision    | normalpg_catalog | abs  | integer
|integer             | normalpg_catalog | abs  | numeric          | numeric             | normalpg_catalog | abs  |
real            | real                | normalpg_catalog | abs  | smallint         | smallint            | normal
 
(6 rows)

Even if you were willing to do that, what about the forty-seven
distinct versions of "+"?  Overloaded operators are not fundamentally
different from overloaded functions.
        regards, tom lane


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: It's June 1; do you know where your release is?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: PANIC: corrupted item lengths