constraint_exclusion not working correctly - Mailing list pgsql-docs

From PG Doc comments form
Subject constraint_exclusion not working correctly
Date
Msg-id 172364933910.395942.11462602571152584372@wrigleys.postgresql.org
Whole thread Raw
Responses Re: constraint_exclusion not working correctly
List pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/ddl-partitioning.html
Description:

Hello,

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.

Regards

pgsql-docs by date:

Previous
From: David Rowley
Date:
Subject: Re: A minor bug in doc. Hovering over heading shows # besides it.
Next
From: Tom Lane
Date:
Subject: Re: constraint_exclusion not working correctly