function overloading

Поиск
Список
Период
Сортировка
От Robert Greimel
Тема function overloading
Дата
Msg-id 1136820608.5143.22.camel@neptune.ing.iac.es
обсуждение исходный текст
Ответы Re: function overloading  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

I have a question regarding function overloading:

assume that you have a function that takes several numeric arguments -
lets for example say 4 arguments: f(a,b,c,d)

Now further assume that internally in the function the first thing you
do is to convert the arguments to double precision, do your calculations
and return the result always in double precision.

In order to allow for all combinations of numeric
(int2,int4,int8,float4,float8) inputs one would now have to define and
write 5^4 = 625 functions !!!!!!!!!!!!!!!

Apart from forcing the function user to use casts, is there any other
way to avoid this madness of writing 625 functions ?

Thanks

Robert


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

Предыдущее
От: Emi Lu
Дата:
Сообщение: Vacuum all tables unders under one schema (not under one database)
Следующее
От: MARCELO_LIMA/Blnet@BLNET.COM
Дата:
Сообщение: read txt and insert table