hyelluas <helen_yelluas@xxxxxxxxxx> writes: > You are right to the point, Tom. > The datex is timestamp with time zone and the constraints were created as > timestamp without time zone. > As soon as I fixed that , it all started working. OK. In case anybody is wondering *why* that fixed it: a comparison between timestamp with time zone and timestamp without time zone isn't immutable, because it depends on the "timezone" runtime parameter to interpret the timestamp without time zone. So the planner can't rely on deductions about the comparison while making the plan --- they might not be true anymore by the time the plan is executed. Upshot is that the constraint exclusion machinery ignores these constraints. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general