public inbox for [email protected]
help / color / mirror / Atom feedFrom: Álvaro Herrera <[email protected]>
To: jian he <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: NOT NULL NOT ENFORCED
Date: Thu, 25 Sep 2025 11:46:28 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CACJufxGzHSggkiMuzVGva=00QsXW_OvWiY2Uj76Ry5sOfoa4uQ@mail.gmail.com>
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/
view thread (10+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: NOT NULL NOT ENFORCED
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox