Re: New partitioning - some feedback

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New partitioning - some feedback
Date: 2017-07-12 08:07:35
Message-ID: 738545bd-f10e-acaf-c8f2-a1545dd1c3d1@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017/07/12 13:09, Amit Langote wrote:
> On 2017/07/12 12:47, Ashutosh Bapat wrote:
>> Do you see that those patches can be used in current discussion in any way?
>
> It wouldn't really be a bad idea to put that patch here, because there's
> no special reason for it to be in the CF for PG 11, if we are talking here
> about changing \d command outputs anyway.

So, here are 4 patches (including the 2 patches that Ashutosh linked to
upthread):

0001: Show relispartition=true relations as "(foreign) partition" and
RELKIND_PARTITIONED_TABLE relations that are not themselves
partitions as "partitioned table"

0002: Hide relispartition=true relations (partitions) by default in the
\d listing (that is, \d without a name pattern); to enable
displaying partitions, add a modifier '++'

0003: In \d+ partitioned_table output (describe partitioned table showing
individual partitions), show if the individual partitions are
partitioned themselves if it actually does have partitions
currently

0004: In \d+ partitioned_table output, do not skip the portion of the
output showing information about partitions if there are currently
no partitions defined; instead show "Number of partitions: 0"

Regarding 0001, while it shows "partition" and "partitioned table" in the
Type column of \d listing, \d name_pattern will still show Table
"schemaname.tablename". For example:

\d
List of relations
Schema | Name | Type | Owner
--------+-------+-------------------+-------
public | xyz | partitioned table | amit
public | xyz1 | partition | amit
public | xyz2 | partition | amit
public | xyz3 | partition | amit
public | xyz31 | partition | amit
(5 rows)

\d xyz*
Table "public.xyz"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
a | integer | | |
Partition key: LIST (a)
Number of partitions: 3 (Use \d+ to list them.)

Table "public.xyz1"
<snip>
Table "public.xyz2"
<snip>
Table "public.xyz3"
<snip>
Table "public.xyz31"
<snip>

...which might seem kind of odd. Do we want to show xyz1 as "Partition
public.xyz1", for example?

Thanks,
Amit

Attachment Content-Type Size
0001-Show-partitions-and-partitioned-tables-as-such-in-d-.patch text/plain 3.1 KB
0002-Exclude-partitions-by-default-from-the-the-psql-d-li.patch text/plain 10.4 KB
0003-Indicate-whether-a-partition-is-itself-partitioned-i.patch text/plain 5.2 KB
0004-Fix-d-output-for-yet-empty-partitioned-tables.patch text/plain 4.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2017-07-12 08:20:33 Re: why not parallel seq scan for slow functions
Previous Message Michael Paquier 2017-07-12 08:06:47 Re: pg_stop_backup(wait_for_archive := true) on standby server