Re: Surprising sequence scan when function call used - Mailing list pgsql-sql

From Tom Lane
Subject Re: Surprising sequence scan when function call used
Date
Msg-id 4164.972530576@sss.pgh.pa.us
Whole thread Raw
In response to Surprising sequence scan when function call used  ("Will Fitzgerald" <fitzgerald@inetmi.com>)
List pgsql-sql
"Will Fitzgerald" <fitzgerald@inetmi.com> writes:
> vdsq=> explain select * from login where login.login = lower('foo');

> Seq Scan on login  (cost=0.00..1361.86 rows=609 width=62)

7.0 is a little bit stupid about cross-data-type comparisons (lower()
yields text, not char(n)).  This example works OK in current sources,
but until 7.1 comes out you'll need to write something likewhere login.login = lower('foo')::char;
Or change the login field to type text...
        regards, tom lane


pgsql-sql by date:

Previous
From: "Shane McEneaney"
Date:
Subject: How to Return number of rows updated in stored procedure
Next
From: indraneel@www.cdfd.org.in
Date:
Subject: Re: Alternate Database Locations