public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alvaro Herrera <[email protected]>
To: Amul Sul <[email protected]>
Cc: jian he <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: CREATE TABLE NOT VALID for check and foreign key
Date: Wed, 15 Jan 2025 11:46:34 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAAJ_b95L6qx-gPsQF8-DyMq2zu-TWtGCXsXh8QbgEWbc17UL=A@mail.gmail.com>
On 2025-Jan-15, Amul Sul wrote:
> I might be mistaken, but I believe this behavior is reasonable since
> we're creating a new table with no data initially. Future inserts will
> be validated against the constraint, ensuring all data added complies
> with it. Given that any data in the table at any time will be valid
> according to the constraint, marking it as "VALID" seems like the
> correct approach, IMO.
Yes to all of the above. But the complaint is not that the behavior is
incorrect. The complaint is that users add NOT VALID and the code
silently behaves as if the parameter was not given, which surprises them
unpleasantly. The WARNING message is there to tell them "look, I
realize you wanted to do this, but I know better, so I decided to ignore
you." That's all.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Use it up, wear it out, make it do, or do without"
view thread (2+ messages)
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], [email protected]
Subject: Re: CREATE TABLE NOT VALID for check and foreign key
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