Mutable CHECK constraints?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Mutable CHECK constraints?
Date: 2023-01-24 04:54:08
Message-ID: b6182298736dceacf0ef5bde42fc5764240f78a7.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

We throw an error if the expression in a CREATE INDEX statement is not IMMUTABLE.
But while the documentation notes that expressions in CHECK constraints are not
to be immutable, we don't enforce that. Why don't we call something like
CheckMutability inside cookConstraint? Sure, that wouldn't catch all abuse,
but it would be better than nothing.

There is of course the worry of breaking upgrade for unsafe constraints, but is
there any other reason not to enforce immutability?

Yours,
Laurenz Albe

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-01-24 05:07:11 Re: Time delayed LR (WAS Re: logical replication restrictions)
Previous Message Amit Kapila 2023-01-24 04:42:37 Re: Perform streaming logical transactions by background workers and parallel apply