Promote a NOT ENFORCED check
A NOT ENFORCED check lets bad rows in. Making it ENFORCED validates the table, so bad rows must go first.
task
Make constraint cheap enforced and validated on temp table p. Try the plain ALTER first and read the error.
Run a query to see rows here.
Run EXPLAIN on the statement under the cursor: Plan tab, button Explain.
No tables yet.
A NOT ENFORCED check lets bad rows in. Making it ENFORCED validates the table, so bad rows must go first.
Make constraint cheap enforced and validated on temp table p. Try the plain ALTER first and read the error.