Re: New thoughts about indexing cross-type comparisons

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Smith <dave(dot)smith(at)candata(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: New thoughts about indexing cross-type comparisons
Date: 2003-09-16 17:24:05
Message-ID: 18420.1063733045@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dave Smith <dave(dot)smith(at)candata(dot)com> writes:
> If this is only dealing with constants, why not just explicitly add a
> cast to the constant of the column type at the planner level. It would
> solve this problem as well ...

> create table test (f int2);
> select * from test where f=cast('1981928928921' as int2);
> ERROR: pg_atoi: error reading "1981928928921": Numerical result out of
> range

> select * from test where f=1981928928921;
> f
> ---
> (0 rows)

Uh, your own example points out why we can't just insert a cast to int2
--- it changes the results. Or am I missing your point?

(In any case, we aren't necessarily dealing with constants.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Hall 2003-09-16 17:55:30 Re: massive quotes?
Previous Message Dave Smith 2003-09-16 17:11:38 Re: New thoughts about indexing cross-type comparisons