public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chao Li <[email protected]>
To: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Fix how some lists are displayed by psql \d+
Date: Fri, 9 Jan 2026 08:45:36 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHut+Pu1puO00C-OhgLnAcECzww8MB3Q8DCsvx0cZWHRfs4gBQ@mail.gmail.com>
References: <CAHut+Pu1puO00C-OhgLnAcECzww8MB3Q8DCsvx0cZWHRfs4gBQ@mail.gmail.com>



> On Jan 9, 2026, at 06:47, Peter Smith <[email protected]> wrote:
> 
> Hi.
> 
> I recently saw that the psql \d+ lists for "Partitions:" are not
> aligned in quite the same way as other lists ("Publications:" etc)
> because they use indents and line breaks differently. e.g. See below:
> 
> test_pub=# \d+ part1
>                                    Partitioned table "public.part1"
> Column |  Type   | Collation | Nullable | Default | Storage |
> Compression | Stats target | Description
> --------+---------+-----------+----------+---------+---------+-------------+--------------+-------------
> a      | integer |           |          |         | plain   |
>    |              |
> Partition of: t1 FOR VALUES FROM (0) TO (50)
> Partition constraint: ((a IS NOT NULL) AND (a >= 0) AND (a < 50))
> Partition key: RANGE (a)
> Publications:
>    "pub1"
>    "pub2"
>    "pub_only"
> Partitions: part1_1 FOR VALUES FROM (0) TO (25), PARTITIONED,
>            part1_2 FOR VALUES FROM (25) TO (50)
> 
> ~~~
> 
> PSA v1
> 0001 - Fix (common code) lists for "Partitions:" and "Child tables:"
> 0002 - Fix list for "Inherits:" in the same way
> 
> ~~~
> 
> The *patched* result for the same example now looks like below. Notice
> that in passing I also removed the comma separators, which are not
> present in the other footer lists.
> 
> test_pub=# \d+ part1
>                                    Partitioned table "public.part1"
> Column |  Type   | Collation | Nullable | Default | Storage |
> Compression | Stats target | Description
> --------+---------+-----------+----------+---------+---------+-------------+--------------+-------------
> a      | integer |           |          |         | plain   |
>    |              |
> Partition of: t1 FOR VALUES FROM (0) TO (50)
> Partition constraint: ((a IS NOT NULL) AND (a >= 0) AND (a < 50))
> Partition key: RANGE (a)
> Publications:
>    "pub1"
>    "pub2"
>    "pub_only"
> Partitions:
>    part1_1 FOR VALUES FROM (0) TO (25), PARTITIONED
>    part1_2 FOR VALUES FROM (25) TO (50)
> 
> ======
> Kind Regards,
> Peter Smith.
> Fujitsu Australia
> <v1-0002-Fix-to-make-psql-d-lists-of-inherits-look-same-as.patch><v1-0001-Fix-to-make-psql-d-lists-of-partitions-look-same-.patch>


This is a simple change, but makes sense to me, making the display looking better.

The code change is straightforward and LGTM.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/










view thread (13+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Fix how some lists are displayed by psql \d+
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox