| From: | Amul Sul <sulamul(at)gmail(dot)com> |
|---|---|
| To: | jian he <jian(dot)universality(at)gmail(dot)com> |
| Cc: | Tender Wang <tndrwang(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Antonin Houska <ah(at)cybertec(dot)at> |
| Subject: | Re: Foreign key validation failure in 18beta1 |
| Date: | 2025-05-29 12:58:08 |
| Message-ID: | CAAJ_b95vZTBeN10J6bTRTAVf6eRTFWZMD3C-OFoaUNz15gahvQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, May 29, 2025 at 5:57 PM jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>
> On Thu, May 29, 2025 at 8:12 PM Amul Sul <sulamul(at)gmail(dot)com> wrote:
> >
> > > >> > [...]
> > > The attached *draft* patch is based on your idea.
> > >
> > > The idea is that we only need to conditionally do
> > > ``tab->constraints = lappend(tab->constraints, newcon);`` within
> > > QueueFKConstraintValidation.
> > > but the catalog update needs to be done recursively.
> >
> > I like this approach, but I don’t think the flag name "recursing" is
> > appropriate, as the flag is meant to indicate whether we want to
> > enqueue constraints for validation or not.
> >
>
> Later, I came up with "need_validate", but it seems "queueValidation"
> is better.
>
> I just realized we have the same problem with ALTER FOREIGN KEY ENFORCED.
> for example:
Yeah, I think adding a "currcon->confrelid == pkrelid" check before
enqueueing validation in ATExecAlterConstrEnforceability() would
address the issue, though I still need to test it thoroughly.
Regards,
Amul
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Matheus Alcantara | 2025-05-29 13:07:31 | Re: Fixing memory leaks in postgres_fdw |
| Previous Message | Robert Haas | 2025-05-29 12:30:53 | Re: Replication slot is not able to sync up |