On Thu, Apr 22, 2021 at 8:01 AM Simon Riggs <
simon.riggs@enterprisedb.com> wrote:
>
> 897795240cfaaed724af2f53ed2c50c9862f951f forgot to reduce the lock
> level for CHECK constraints when allowing them to be NOT VALID.
>
> This is simple and safe, since check constraints are not used in
> planning until validated.
The patch also reduces the lock level when NOT VALID is not specified, which didn't seem to be the intention.
# begin;
BEGIN
*# alter table alterlock2 add check (f1 > 0);
ALTER TABLE
*# select * from my_locks order by 1;
relname | max_lockmode
------------+-----------------------
alterlock2 | ShareRowExclusiveLock
(1 row)
--
John Naylor
EDB:
http://www.enterprisedb.com