Re: dropping partitioned tables without CASCADE

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dropping partitioned tables without CASCADE
Date: 2017-03-05 10:02:08
Message-ID: CANP8+jLWKEfUrDXzicKRPDbZ_LmdN7N0wqAVAyt=-swWmLaJnw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5 March 2017 at 07:59, Ashutosh Bapat
<ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
>>
>> I used a slight modification of the case mentioned on the docs. I
>> confirm this fails repeatably for me on current HEAD.
>>
>> CREATE TABLE cities (
>> city_id bigserial not null,
>> name text not null,
>> population bigint
>> ) PARTITION BY LIST (left(lower(name), 1));
>>
>> CREATE TABLE cities_ab
>> PARTITION OF cities (
>> CONSTRAINT city_id_nonzero CHECK (city_id != 0)
>> ) FOR VALUES IN ('a', 'b')
>> PARTITION BY RANGE (population);
>>
>> drop table cities;
>> ERROR: cannot drop table cities because other objects depend on it
>> DETAIL: table cities_ab depends on table cities
>> HINT: Use DROP ... CASCADE to drop the dependent objects too.
>
> I think that's what this patch fixes. Do you see this behaviour after
> applying the patch?

It does seems as if I've made a mistake there. The patch passes.
Thanks for checking.

I will apply tomorrow if no further comments.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2017-03-05 10:10:58 Re: Cleanup: avoid direct use of ip_posid/ip_blkid
Previous Message Pavel Stehule 2017-03-05 09:32:18 Re: patch: function xmltable