Split ATExecValidateConstraint into reusable pieces

Álvaro Herrera <alvherre@alvh.no-ip.org>

Commit: 86374c9a0e304520044ab8b2cb84849c7db4a9fa
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2025-01-16T15:44:24Z
Releases: 18.0
Split ATExecValidateConstraint into reusable pieces

With this, we have separate functions to add validation requests to
ALTER TABLE's phase 3 queue for check and foreign key constraints, which
allows reusing them in future commits -- particularly this will allow us
to perform validation of invalid foreign key constraints in partitioned
tables.

We could have let the check constraint code alone since we don't need to
reuse that for anything at this point, but it seems cleaner and more
consistent to do both at the same time.

Author: Amul Sul <sulamul@gmail.com>
Discussion: https://postgr.es/m/CAAJ_b96Bp=-ZwihPPtuaNX=SrZ0U6ZsXD3+fgARO0JuKa8v2jQ@mail.gmail.com

Files

PathChange+/−
src/backend/commands/tablecmds.c modified +165 −106

Discussion