Re: dropping partitioned tables without CASCADE

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dropping partitioned tables without CASCADE
Date: 2017-02-22 04:46:54
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

Looks good to me. In the attached patch I have added a comment
explaining the reason to make partition tables "Auto" dependent upon
the corresponding partitioned tables.

In the tests we are firing commands to drop partitioned table, but are
not checking whether those tables or the partitions are getting
dropped or not. Except for drop_if_exists.sql, I did not find that we
really check this. Should we try a query on pg_class to ensure that
the tables get really dropped?

On Wed, Feb 22, 2017 at 7:26 AM, Amit Langote
<Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> On 2017/02/22 10:49, Amit Langote wrote:
>> On 2017/02/21 20:17, Ashutosh Bapat wrote:
>>> Are you sure you have attached the right patch?
>> Oops, really fixed this time.
> Sorry again, 3rd time's a charm. I copy-paste the hunk below from the
> patch file before I attach it to make sure:
> - recordDependencyOn(&childobject, &parentobject, DEPENDENCY_NORMAL);
> + if (child_is_partition)
> + recordDependencyOn(&childobject, &parentobject, DEPENDENCY_AUTO);
> + else
> + recordDependencyOn(&childobject, &parentobject, DEPENDENCY_NORMAL);
> Thanks,
> Amit

Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

Attachment Content-Type Size
0001-Allow-dropping-partitioned-table-without-CASCADE_v2.patch application/octet-stream 11.7 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Rafia Sabih 2017-02-22 04:55:15 Enabling parallelism for queries coming from SQL or other PL functions
Previous Message Ashutosh Bapat 2017-02-22 04:26:08 Re: foreign partition DDL regression tests