Re: [HACKERS] dropping partitioned tables without CASCADE - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: [HACKERS] dropping partitioned tables without CASCADE
Date
Msg-id CAFjFpRcs5fOSfaAGAjT5C6=YvDD7MRx3knf_SpB5DQZOJgjerA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] dropping partitioned tables without CASCADE  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [HACKERS] dropping partitioned tables without CASCADE  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
>
> 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.

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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: "Okano, Naoki"
Date:
Subject: Re: [HACKERS] Adding the optional clause 'AS' in CREATE TRIGGER
Next
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] Logical replication existing data copy