Skip site navigation (1) Skip section navigation (2)

Re: why provide cross type arithmetic operators

From: "ykhuang" <hyk(at)ruc(dot)edu(dot)cn>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: why provide cross type arithmetic operators
Date: 2008-01-22 05:55:34
Message-ID: fn40l4$2vl4$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
for example,

postgres=# select int2'1' + int8'1';
ERROR:  operator is not unique: smallint + bigint
LINE 1: select int2'1' + int8'1';
                       ^
HINT:  Could not choose a best candidate operator. You may need to add 
explicit
type casts.

there are int4 + int8 and int8 + int8, but no int2 + int8, so two operators 
available, they are int4 + int8 and int8 + int8,
system can't choose a best candidate operator.


"ykhuang" <hyk(at)ruc(dot)edu(dot)cn> :fn3n3o$1g5r$1(at)news(dot)hub(dot)org(dot)(dot)(dot)
> there are many cross type arithmetic operators, like int2 + int4, int8 + 
> int4, I think these can be deleted. Here are the reasons, after deleted,
> int2 + int4 will choose the operator int4 + int4, int8 + int4 choose int8 
> + int8, Is that ok? Thanks.
> 



In response to

pgsql-bugs by date

Next:From: hubert depesz lubaczewskiDate: 2008-01-22 08:59:28
Subject: bad message or bad privilege check in foreign key constraint
Previous:From: ykhuangDate: 2008-01-22 03:14:25
Subject: why provide cross type arithmetic operators

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group