Re: Dropping partitioned table drops a previously detached partition

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Rahila Syed <rahilasyed90(at)gmail(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dropping partitioned table drops a previously detached partition
Date: 2017-06-14 05:02:57
Message-ID: CAFjFpReVoyQv0iERutxgespZm5V4QDkMt7K9VgmnzTfk7e8u8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 14, 2017 at 10:21 AM, Ashutosh Bapat
<ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
> On Tue, Jun 13, 2017 at 7:14 PM, Rahila Syed <rahilasyed90(at)gmail(dot)com> wrote:
>> I reviewed and tested
>> 0001-Dependency-between-partitioned-table-and-partition_v1.patch
>> It applies cleanly on master and make check passes.
>>
>> Following are few comments:
>>
>>>/*
>>> * Drop the dependency created by StoreCatalogInheritance1 (CREATE TABLE
>>> * INHERITS/ALTER TABLE INHERIT -- refclassid will be RelationRelationId)
>>> or
>>> * heap_create_with_catalog (CREATE TABLE OF/ALTER TABLE OF -- refclassid
>>> will
>>> * be TypeRelationId). There's no convenient way to do this, so go
>>> trawling
>>> * through pg_depend.
>>> */
>>>static void
>>>drop_parent_dependency(Oid relid, Oid refclassid, Oid refobjid,
>> DependencyType deptype)
>>
>> This is not directly related to this patch but still would like to mention.
>> drop_parent_dependency() is being used to drop the dependency created
>> by CREATE TABLE PARTITION OF command also, so probably the comment
>> needs to be modified to reflect that.
>>
>
> The comment is fine for dependency created by CREATE TABLE PARTITION
> OF since that too goes through StoreCatalogInheritance1(). But it's
> not correct for CREATE TABLE ... OF <composite type> since that does
> not go through StoreCatalogInheritance1().
>
I missed "or" part of the prologue while writing this. Now that I have
read it carefully, the prologue looks good to me.
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-06-14 05:34:51 Re: pgrowlocks relkind check
Previous Message Ashutosh Bapat 2017-06-14 05:01:41 Re: Dropping partitioned table drops a previously detached partition