public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alvaro Herrera <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: jian he <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Rushabh Lathia <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
Date: Thu, 3 Apr 2025 10:07:41 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 2025-Apr-03, Peter Eisentraut wrote:
> It occurred to me that we will also want to have NOT NULL NOT ENFORCED
> constraints eventually. As we have discussed elsewhere, the NOT
> ENFORCED state is closely related to the NOT VALID state. So that
> should probably be considered in the design here.
Yeah, I don't think there's time to shoehorn NOT ENFORCED status for
not-null constraints. I'd guess that it'd take at least a couple of
weeks to make that work.
> Reading up on this again now, I'm confused about putting the NOT VALID
> state for not-null constraints into pg_attribute. We have catalogued
> not-null constraints now, so we can put metadata for them into
> pg_constraint! And we have NOT VALID and NOT ENFORCED flags in
> pg_constraint already.
>
> So what is the purpose of the attnotnullvalid field? In the latest posted
> patch, I don't see this column used in the executor for the actual
> constraint checking. So is this all merely for clients to understand the
> constraint metadata? If we add more metadata for not-null constraints, do
> we need to add a new pg_attribute flag for each one? That doesn't seem
> right.
The new flag is there for quick access by get_relation_info. We could
easily not have it otherwise, because clients don't need it, but its
lack would probably make planning measurably slower because it'd have to
do syscache access for every single not-null constraint to figure out if
it's valid or not.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)
view thread (3+ 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], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints
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