Re: problems with foreign keys on partitioned tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: problems with foreign keys on partitioned tables
Date
Msg-id 201901241637.joxln3ew2ysm@alvherre.pgsql
Whole thread Raw
In response to Re: problems with foreign keys on partitioned tables  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-hackers
On 2019-Jan-25, Amit Langote wrote:

> On Fri, Jan 25, 2019 at 12:30 AM Amit Langote <amitlangote09@gmail.com> wrote:

> > Doesn't the following performDeletion() at the start of
> > ATExecDropConstraint(), through findDependentObject()'s own recursion,
> > take care of deleting *all* constraints, including those of?
> 
> Meant to say: "...including those of the grandchildren?"
> 
> >         /*
> >          * Perform the actual constraint deletion
> >          */
> >         conobj.classId = ConstraintRelationId;
> >         conobj.objectId = con->oid;
> >         conobj.objectSubId = 0;
> >
> >         performDeletion(&conobj, behavior, 0);

Of course it does when the dependencies are set up -- but in the
approach we just gave up on, those dependencies would not exist.
Anyway, my motivation was that performMultipleDeletions has the
advantage that it collects all objects to be dropped before deleting
anyway, and so the error that a constraint was dropped in a previous
recursion step would not occur.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PSA: we lack TAP test coverage on NetBSD and OpenBSD
Next
From: Alvaro Herrera
Date:
Subject: Re: PSA: we lack TAP test coverage on NetBSD and OpenBSD