On 2025-Sep-24, jian he wrote:
> currently NOT VALID NOT NULL dumped
> constraint separately, NOT NULL NOT ENFORCED constraints can also be dumped
> separately.
>
> CREATE TABLE tx3 (x int not null not enforced);
>
> can be dumped as:
>
> CREATE TABLE public.tx3 (x integer);
> ALTER TABLE public.tx3 ADD CONSTRAINT tx3_x_not_null NOT NULL x NOT ENFORCED;
> ---------------
> note: currently not enforced check constraint is dumped separately.
Hmm, I wonder what's the reason for this. Seems quite useless. Why
wouldn't we dump unenforced constraint together with the table? The
case is different from invalid constraints, which have to be created
after data is loaded.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/