"Brian Tarbox" <btarbox(at)theworld(dot)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. (Yeah, I know, it's a pain in the neck. We've had a lot of
discussions about how to fix this without breaking datatype extensibility;
no luck so far.)
regards, tom lane