Re: doc pg_constraint.convalidated column description need update

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Robert Treat <rob(at)xzilla(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: doc pg_constraint.convalidated column description need update
Date: 2025-05-06 08:49:02
Message-ID: CACJufxHs_T9u+4UFaWy6kf8aki7zqkAUmMXLdVXBjw3Dnh2++w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, May 3, 2025 at 11:42 PM Robert Treat <rob(at)xzilla(dot)net> wrote:
> As such, attached patch removes the above, and attempts some clean up
> of the documentation in ALTER TABLE to better clarify the behavior
> around valid/not valid, enforced/not enforced, and how it affects
> different constraints, with some additional literal tag formatting
> changes.
>

<para>
- Adding an enforced <literal>CHECK</literal> or <literal>NOT NULL</literal>
- constraint requires scanning the table to verify that existing
rows meet the
- constraint, but does not require a table rewrite. If a
<literal>CHECK</literal>
- constraint is added as <literal>NOT ENFORCED</literal>, the validation will
- not be performed.
+ Adding a <literal>CHECK</literal> or <literal>NOT NULL</literal>
+ constraint requires scanning the table to verify that existing rows meet
+ the constraint, but does not require a table rewrite. IF a
+ <literal>CHECK</literal> constraint is added as
+ <literal>NOT ENFORCED</literal>, no verification is performed.
</para>

"IF" should be "if".
i don't know which one ("validation" or "verification") is more accureate,
but i found this
(https://www.eviltester.com/2018/09/no-verification-validation.html)

here, we should also mention <literal>FOREIGN KEY</literal> constraint?

- This form validates a foreign key, check, or not-null constraint that was
- previously created as <literal>NOT VALID</literal>, by scanning the
+ This form validates a <literal>FOREIGN KEY</literal>,
+ <literal>CHECK</literal>, or <literal>NOT NULL</literal> constraint that
+ was previously created as <literal>NOT VALID</literal>, by scanning the
table to ensure there are no rows for which the constraint is not
- satisfied. If the constraint is not enforced, an error is thrown.
+ satisfied. If the constraint was created as
+ <literal>NOT ENFORCED</literal>, an error is thrown.
I think this changes should be great. original text
"If the constraint is not enforced" can mean "some exists row not
satisfied the constraint
condition" or "the constraint is marked as <literal>NOT ENFORCED</literal>".

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-05-06 09:23:21 Re: 2025-05-08 release announcement draft
Previous Message Pavel Seleznev 2025-05-06 08:48:36 Re: encode/decode support for base64url