On Tue, Nov 21, 2017 at 4:36 AM, Amit Langote <langote_amit...@lab.ntt.co.jp> wrote: >>> The attached will make the constraint to look like: >> >> Uh, if the constraint exclusion logic we're using is drawing false >> conclusions, we need to fix it so it doesn't, not change the >> constraint so that the wrong logic gives the right answer. > > I did actually consider it, but ended up concluding that constraint > exclusion is doing all it can using the provided list partition constraint > clauses. > > If all predicate_refuted_by() receives is the expression tree (AND/OR) > with individual nodes being strict clauses involving partition keys (and > nothing about the nullness of the keys), the downstream code is just > playing by the rules as explained in the header comment of > predicate_refuted_by_recurse() in concluding that query's restriction > clause a = 2 refutes it.
Oh, wait a minute. Actually, I think predicate_refuted_by() is doing the right thing here. Isn't the problem that mc2p2 shouldn't be accepting a (2, null) tuple at all? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company