Обсуждение: bug? in current cvs with bigint datatype

Поиск
Список
Период
Сортировка

bug? in current cvs with bigint datatype

От
Barry Lind
Дата:
I just did a fresh build from current cvs and found the following 
regression from 7.2:

create table test (cola bigint);
update test set cola = 10000000000;

In 7.3 the update results in the following error:

ERROR:  column "cola" is of type 'bigint' but expression is of type 
'double precision'You will need to rewrite or cast the expression

In 7.2 the update worked. (updated 0 rows in this case)

It is interesting to note that if I use 'cola = 10000000000' in a where 
clause instead of as an assignment (i.e. select * from test where cola = 
10000000000) this works in both 7.3 and 7.2.

thanks,
--Barry



Re: bug? in current cvs with bigint datatype

От
Tom Lane
Дата:
Barry Lind <barry@xythos.com> writes:
> create table test (cola bigint);
> update test set cola = 10000000000;
> ERROR:  column "cola" is of type 'bigint' but expression is of type 
> 'double precision'
>     You will need to rewrite or cast the expression

dtoi8 is currently marked "not proimplicit".  People seem to have lost
interest in the discussion thread about which coercions should be allowed
implicitly, but the issues still need to be resolved before 7.3.

This particular example perhaps says that when assigning to a table
column, we should allow not-proimplicit coercions to be invoked
implicitly anyway.  Since there isn't any question about either the
source type or the target type, allowing this case doesn't seem to pose
any risk of surprising choices being made.

Comments anyone?
        regards, tom lane