-- Add the check constraint
alter table public.test_partition_10_25 add constraint test_partition_10_25_constraint CHECK (id >= 10 AND id <25) NOT VALID;
update pg_constraint pgc
SET convalidated = true
FROM pg_class c
WHERE
c.oid = pgc.conrelid
AND connamespace = 'public'::regnamespace::oid
AND c.relname = 'test_partition_10_25'
AND conname = 'test_partition_10_25_constraint';