Re: [HACKERS] interesting difference for queries...

2002-12-04 Thread Rod Taylor
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

Re: [HACKERS] interesting difference for queries...

2002-12-04 Thread Tom Lane
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

Re: [HACKERS] interesting difference for queries...

2002-12-04 Thread Rod Taylor
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

[HACKERS] interesting difference for queries...

2002-12-04 Thread Mario Weilguni
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