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: Simon Riggs <simon(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dropping partitioned tables without CASCADE
Date: 2017-09-04 04:51:32
Message-ID: CAFjFpRe=wXrqYre1bRRd8gQf-XQnJEsf-OXyfV4aE0TGHFRDGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,
Thomas's application to track patches told me that this patch needs
rebase. It also required some changes to the code. Here's the updated
version. I have squashed those two patches together.

On Tue, Mar 14, 2017 at 6:35 PM, Ashutosh Bapat
<ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
> Added this to 2017/7 commitfest to keep a track of it.
>
> On Wed, Mar 8, 2017 at 3:39 PM, Amit Langote
> <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> On 2017/03/08 18:27, Ashutosh Bapat wrote:
>>>>
>>>> About the other statement you changed, I just realized that we should
>>>> perhaps do one more thing. Show the Number of partitions, even if it's 0.
>>>> In case of inheritance, the parent table stands on its own when there are
>>>> no child tables, but a partitioned table doesn't in the same sense. I
>>>> tried to implement that in attached patch 0002. Example below:
>>>>
>>>> create table p (a int) partition by list (a);
>>>> \d p
>>>> <snip>
>>>> Partition key: LIST (a)
>>>> Number of partitions: 0
>>>>
>>>> \d+ p
>>>> <snip>
>>>> Partition key: LIST (a)
>>>> Number of partitions: 0
>>>>
>>>> create table p1 partition of p for values in (1);
>>>> \d p
>>>> <snip>
>>>> Partition key: LIST (a)
>>>> Number of partitions: 1 (Use \d+ to list them.)
>>>>
>>>> \d+ p
>>>> <snip>
>>>> Partition key: LIST (a)
>>>> Partitions: p1 FOR VALUES IN (1)
>>>
>>> I liked that. PFA 0002 updated. I changed one of \d output to \d+ to
>>> better test partitioned tables without partitions in verbose and
>>> non-verbose mode. Also, refactored the your code to have less number
>>> of conditions. Please let me know if it looks good.
>>
>> Thanks, looks good.
>>
>> Regards,
>> Amit
>>
>>
>
>
>
> --
> Best Wishes,
> Ashutosh Bapat
> EnterpriseDB Corporation
> The Postgres Database Company

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

Attachment Content-Type Size
0001-Improve-d-output-of-a-partitioned-table_v2.patch text/x-patch 8.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2017-09-04 04:57:23 Re: asynchronous execution
Previous Message Michael Paquier 2017-09-04 04:46:17 Re: [Proposal] Allow users to specify multiple tables in VACUUM commands