Postgres 9.1 query plan not using check_constraints on partitions after large data load
A couple comments given the answer here.  First PostgreSQL currently does not check the where clause functions to see if all equality constraints can be met properly on all tables.  So you have to specify the condition for the partition often manually in the where clause.

A major point I would make here would be that if you are not doing a lot of frequent bulk operations, you may find that partitioning is not a net win here.  You may find that partial indexes get you what you want in a more flexible manner.  For example you could have a series of partial indexes:

CREATE INDEX markets_0_idx markets (id) WHERE zip between '00000' AND '09999';


and so forth.  However for a single zip-code lookup you are probably best to have just an index on zip.  Premature optimization is the root of all evil.