Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, Suraj Kharage <suraj(dot)kharage(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints
Date: 2025-01-08 09:47:48
Message-ID: 202501080947.upnia6ptv4dm@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024-Nov-25, Robert Haas wrote:

> In a simple implementation of ALTER TABLE this would be true, but I
> don't see why it should need to be true in ours. It should be possible
> to notice that there's an existing NOT NULL constraint and use that as
> evidence that the new one can be added without needing to revalidate
> the table contents. ALTER TABLE does similar things already. For
> instance, TryReuseIndex() can attempt to attach an existing index file
> to a new index definition without rebuilding it; TryReuseForeignKey
> can attempt to re-add a foreign key constraint without needing to
> revalidate it. But even more to the point, ATAddCheckNNConstraint and
> MergeWithExistingConstraint know about merging a newly-added
> constraint with a preexisting one without needing to revalidate the
> table.

I think you're explaining why we need this patch, which seems a bit
useless in the thread where this patch was posted.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-01-08 09:50:17 Re: IANA timezone abbreviations versus timezone_abbreviations
Previous Message Dean Rasheed 2025-01-08 09:38:53 Re: Adding OLD/NEW support to RETURNING