Re: NOT ENFORCED constraint feature

From: Amul Sul <sulamul(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: NOT ENFORCED constraint feature
Date: 2024-11-04 12:17:27
Message-ID: CAAJ_b96=qk=Sa4YR2+nB9Yea+Q7O4uQDcojCpfEgCPA3oYp1rg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 15, 2024 at 10:00 AM Amul Sul <sulamul(at)gmail(dot)com> wrote:
>
> On Wed, Oct 9, 2024 at 2:44 PM Joel Jacobson <joel(at)compiler(dot)org> wrote:
> >
> > On Tue, Oct 8, 2024, at 11:06, Amul Sul wrote:
> > > The attached patch proposes adding the ability to define CHECK and
> > > FOREIGN KEY constraints as NOT ENFORCED.
> >
> > Thanks for working on this!
> >
> > > Adding NOT ENFORCED to CHECK constraints is simple, see 0001 patch,
> >
> > I've looked at the 0001 patch and think it looks simple and straight forward.
> >
>
> Thanks for looking into it.
>
> > > but implementing it for FOREIGN KEY constraints requires more code due
> > > to triggers, see 0002 - 0005 patches.
> >
> > I can't say that much yet about the code changes in 0002 - 0005 yet,
> > but I've tested the patches and successfully experimented with the feature.
> >
> > Also think the documentation is good and sound. Only found a minor typo:
> > - Adding a enforced <literal>CHECK</literal> or <literal>NOT NULL</literal>
> > + Adding an enforced <literal>CHECK</literal> or <literal>NOT NULL</literal>
> >
>
> Ok, will fix it in the next version.

Attached is the rebased version on the latest master(5b0c46ea093),
including the aforesaid fix.

Regards,
Amul

Attachment Content-Type Size
v2-0001-Add-support-for-NOT-ENFORCED-in-CHECK-constraints.patch application/octet-stream 42.3 KB
v2-0002-refactor-split-ATExecAlterConstrRecurse.patch application/octet-stream 8.3 KB
v2-0003-refactor-Change-ATExecAlterConstrRecurse-argument.patch application/octet-stream 6.2 KB
v2-0004-Remove-hastriggers-flag-check-before-fetching-FK-.patch application/octet-stream 10.5 KB
v2-0005-Add-support-for-NOT-ENFORCED-in-foreign-key-const.patch application/octet-stream 53.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-11-04 12:25:43 Re: PG_TEST_EXTRA and meson
Previous Message Kirill Reshke 2024-11-04 11:50:50 Re: Add missing tab completion for ALTER TABLE ADD COLUMN IF NOT EXISTS