polm23
polm23

Reputation: 15623

Are constraint checks on partitions in postgres always a good idea?

Suppose I have a table partitioned by month in postgres where the following are true:

Do constraint checks on the partitions / child tables help me here? Since the trigger handles the end-of-month period, it seems they would be redundant and thus unhelpful, but I feel I might be missing something.

Upvotes: 0

Views: 172

Answers (1)

Frank Heikens
Frank Heikens

Reputation: 127297

The constraints are needed for the query planner, it uses the constraint to know where to find specific data. See the documentation.

Upvotes: 3

Related Questions