"Ian Turner" <ian.tur...@deshaw.com> writes: > The following queries are equivalent, because there are no integers between > 5 and 6 and because the BETWEEN operator contemplates a closed range. > SELECT * FROM example WHERE pk IN (5,6); > SELECT * FROM example WHERE pk BETWEEN 5 AND 6;
The planner intentionally does not do very many inferences that are as datatype-dependent as this one would be. It doesn't fit into the system design. For the most part the possible gain is not large anyway. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs