Materialized views and check constraints

From: ZeroImpl(at)gmail(dot)com
To: pgsql-hackers(at)postgresql(dot)org
Subject: Materialized views and check constraints
Date: 2024-04-04 17:25:11
Message-ID: CAOcaaC6_7QqF42E_jt74HJydh6ub8ooMw7+OFzBuvubioeWSXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Is there any way to add check constraints to a materialized view, or plans
to add this feature in the future?

Attempting to use "ALTER TABLE tablename ADD CHECK(...)" or "ALTER
MATERIALIZED VIEW" result in error:

ERROR: "tablename" is not a table or foreign table

Check constraints are used by the optimizer, eg for partition removal, so
this would be a useful feature to me.

--
Daniel

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-04-04 17:28:40 Re: Popcount optimization using AVX512
Previous Message Heikki Linnakangas 2024-04-04 17:21:18 CSN snapshots in hot standby