On Sat, 2003-05-31 at 13:13, Tom Lane wrote:
> "Brian Tarbox" <btarbox@theworld.com> writes:
> > When I say "explain select * from Patient where Patient_primary_key = 100"
> > I get sequential scan.
>
> Perhaps Patient_primary_key is not an integer field? If not, you need
> to cast the constant 100 to the right type. Or write '100' with
> single quotes around it, which leaves Postgres to choose the constant's
> datatype.
Out of curiosity, why don't we confirm the unquoted value is an integer,
numeric, etc, then change it into type 'unknown'? From that point
forward it would be treated like it's quoted counterpart.
Is this noticeably slower or am I missing something?
--
Rod Taylor <rbt@rbt.ca>
PGP Key: http://www.rbt.ca/rbtpub.asc