On Wed, 2002-12-04 at 12:22, Tom Lane wrote:
> Rod Taylor <[EMAIL PROTECTED]> writes:
> >> cms=# CREATE TABLE foo(bar int);
> >> CREATE
> >> cms=# SELECT * from foo where bar=1.7;
>
> > This is a numeric to integer coercion, which rounds
>
> No, it's an integer to numeric promotion (the var is pr
Rod Taylor <[EMAIL PROTECTED]> writes:
>> cms=# CREATE TABLE foo(bar int);
>> CREATE
>> cms=# SELECT * from foo where bar=1.7;
> This is a numeric to integer coercion, which rounds
No, it's an integer to numeric promotion (the var is promoted, not the
constant). Obviously the '=' can never retur
On Wed, 2002-12-04 at 11:21, Mario Weilguni wrote:
> I noticed an interesting difference in query behaviour:
>
> cms=# CREATE TABLE foo(bar int);
> CREATE
> cms=# SELECT * from foo where bar=1.7;
This is a numeric to integer coercion, which rounds
rbt=# select 1.7::int;
int4
--
2
(1 ro
I noticed an interesting difference in query behaviour:
cms=# CREATE TABLE foo(bar int);
CREATE
cms=# SELECT * from foo where bar=1.7;
bar
-
(0 rows)
cms=# SELECT * from foo where bar='1.7';
ERROR: pg_atoi: error in "1.7": can't parse ".7"
Is this the same problem as index usage with/witho