dropping column prevented due to inherited index

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: dropping column prevented due to inherited index
Date: 2019-09-04 05:36:33
Message-ID: CA+HiwqE9kuBsZ3b5pob2-cvE8ofzPWs-og+g8bKKGnu6b4-yTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Maybe I'm forgetting some dependency management discussion that I was
part of recently, but is the following behavior unintentional?

create table p (a int, b int, c int) partition by list (a);
create table p1 partition of p for values in (1) partition by list (b);
create table p11 partition of p1 for values in (1);
create index on p (c);
alter table p drop column c;
ERROR: cannot drop index p11_c_idx because index p1_c_idx requires it
HINT: You can drop index p1_c_idx instead.

Dropping c should've automatically dropped the index p_c_idx and its
children and grandchildren, so the above complaint seems redundant.

Thanks,
Amit

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kuntal Ghosh 2019-09-04 06:14:23 Re: [PATCH] psql: add tab completion for \df slash command suffixes
Previous Message Kuntal Ghosh 2019-09-04 05:32:31 Re: [Patch] Invalid permission check in pg_stats for functional indexes