Re: dropping column prevented due to inherited index

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: dropping column prevented due to inherited index
Date: 2019-10-07 02:01:13
Message-ID: CA+HiwqELTB1HnVPCWTYHgT73+aXibWg0Fz7QCGfeMr5g0pVqUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

On Fri, Oct 4, 2019 at 5:57 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Oct 03, 2019 at 09:18:12AM -0300, Alvaro Herrera wrote:
> > Hmm. I wonder if we shouldn't adopt the coding pattern we've used
> > elsewhere of collecting all columns to be dropped first into an
> > ObjectAddresses array, then use performMultipleDeletions.
>
> +1. That's the common pattern these days, because that's more
> performant.

Actually I don't see the peformMultipleDeletions() pattern being used
for the situations where there are multiple objects to drop due to
inheritance. I only see it where there are multiple objects related
to one table. Maybe it's possible to apply to the inheritance
situation though, but in this particular case, it seems a bit hard to
do, because ATExecDropColumn steps through an inheritance tree level
at a time.

But maybe I misunderstood Alvaro's suggestion?

> I think that the patch should have regression tests.

I have added one in the attached updated patch.

Thanks,
Amit

Attachment Content-Type Size
ATExecDropColumn-inh-recursion-fix_v2.patch application/octet-stream 3.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Suraj Kharage 2019-10-07 03:10:48 Re: identity column behavior in WHEN condition for BEFORE EACH ROW trigger
Previous Message Robert Haas 2019-10-07 02:00:02 Re: How to retain lesser paths at add_path()?