Re: Prefered Types

From: Зотов Роман <zotov(at)oe-it(dot)ru>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Prefered Types
Date: 2011-05-04 05:00:42
Message-ID: 4DC0DD7A.7030806@oe-it.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

04.05.2011 0:00, Alvaro Herrera пишет:
> Excerpts from Зотов Роман's message of mar may 03 16:31:31 -0300 2011:
>
>> but here we can see problem like
>> F(smallint)
>> F(integer)
>> but call like F(float)
>> i wouldn`t like to fail it.
> I think this particular example would be a mistake, because that cast
> would be lossy, so you want to invoke it only when the user explicitely
> selects it. The other way around would be fine, I think, that is,
> F(float)
> F(float8)
> and the call is F(int)
As i think i not must write function with Float, String, and many other
arg when my function have INT arg... and if caller wouln`t think about
types he cant use your strong types
why it not must work like as assignment??? why implicit and assignment
is different???
I know only implicit and explicit casts and i think imlicit=asssign

>
>> PS This patch needet, because in any case we must calc prefer more
>> smartly, yes this patch is 1/10 of full solution, but it`s first step!!!
> Well, if the other 9/10 were clear, there would be no discussion. The
> problem is that the missing bits have not been designed and thus we
> don't know if this 1/10 will be useful to them. We need to find a
> complete design before committing to any initial portion which may turn
> out to be bogus down the road.
>
Yes, but while you think what update table1 set IntField = FloatField is
valid
but Select FuncWithIntArg(FloatArg) is not valid
you have no problems in current solution, because it works same :)

--
С уважением,
Зотов Роман Владимирович
руководитель Отдела разработки
ЗАО "НПО Консультант"
г.Иваново, ул. Палехская, д. 10
тел./факс: (4932) 41-01-21
mailto: zotov(at)oe-it(dot)ru

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Johann 'Myrkraverk' Oskarsson 2011-05-04 05:25:31 Re: DLL export with mingw-w64: currently a no-op
Previous Message Tom Lane 2011-05-04 04:19:51 Re: branching for 9.2devel