Re: [HACKERS] Re: type coersion (was OR clause status) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Re: type coersion (was OR clause status)
Date
Msg-id 4596.902703965@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Re: type coersion (was OR clause status)  ("Thomas G. Lockhart" <lockhart@alumni.caltech.edu>)
Responses Re: [HACKERS] Re: type coersion (was OR clause status)
List pgsql-hackers
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu> writes:
> So far, I haven't seen cases where the parser has tried to do "the wrong
> thing", only cases where "the right thing" causes the index handling to
> miss the boat...

I disagree, actually.  In the example

    select ... where i2 = 400;

I claim the parser is doing the wrong thing by representing this as
"where int4(i2) = 400::int4" rather than "where i2 = 400::int2".
It is not really reasonable to expect the optimizer to clean up
after that initial mistake.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] thread-safe libpq and DBD::Pg
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: type coersion (was OR clause status)