Re: constraint_exclusion not working correctly - Mailing list pgsql-docs

From Tom Lane
Subject Re: constraint_exclusion not working correctly
Date
Msg-id 661806.1723775179@sss.pgh.pa.us
Whole thread Raw
In response to constraint_exclusion not working correctly  (PG Doc comments form <noreply@postgresql.org>)
List pgsql-docs
PG Doc comments form <noreply@postgresql.org> writes:
> I have noted that, in order for constraint exclusion to work correctly when
> partitioning using inheritance, we must use simple comparisons in check
> constraints (e.g., =, >=, <=, BETWEEN, etc.). If conditions are combined
> using AND or OR, unnecessary partitions may be scanned.

> Therefore, the example in this PostgreSQL documentation will not work
> properly with constraints like CHECK (logdate >= DATE '2006-02-01' AND
> logdate < DATE '2006-03-01'). However, it will work with the BETWEEN
> operator.

The example in the documentation works perfectly well for me.

            regards, tom lane



pgsql-docs by date:

Previous
From: PG Doc comments form
Date:
Subject: constraint_exclusion not working correctly
Next
From: "yanliang lei"
Date:
Subject: question about "vacuum full" command