Re: BUG #10254: Joined Constraints not invoked on date ranges - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #10254: Joined Constraints not invoked on date ranges
Date
Msg-id 5962.1399499355@sss.pgh.pa.us
Whole thread Raw
In response to BUG #10254: Joined Constraints not invoked on date ranges  (christopher.hamel@zimmer.com)
List pgsql-bugs
christopher.hamel@zimmer.com writes:
> If I specifically invoke the range on both the h and l tables, it will work
> fine, but since the join specifies those fields have to be the same, can
> that condition be propagated automatically?

No.  We currently deduce equality transitively, so the planner is able to
extract the constraint l.transaction_date = '2014-03-01' from your query
(and then use that to reason about the check constraints on l's children).
But there's nothing comparable for inequalities, and it's not clear that
adding such logic to the planner would be a net win.  It would be more
complicated than the equality case and less often useful.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #10256: COUNT(*) behaves sort of like RANK() when used over a window containing an ORDER BY
Next
From: Emanuel Calvo
Date:
Subject: Re: BUG #10255: CREATE COLLATION bug on 9.4