Re: Partitions: \d vs \d+

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Maksim Milyutin <milyutinma@gmail.com>, Jesper Pedersen <jesper.pedersen@redhat.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-09-29T20:03:41Z
Lists: pgsql-hackers
On Thu, Sep 28, 2017 at 9:33 PM, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
> Perhaps, there is no case when "No partition constraint" should be output,
> but I may be missing something.

The case arises when a partitioned table has a default partition but
no other partitions.

I have committed the patch.

In v10, it's impossible to have a partition with no partition
constraint, and if it does happen due to some bug, the worst that will
happen is \d will just print nothing, rather than explicitly printing
that there's no constraint.  That's not a serious problem and it
shouldn't happen anyway, so no back-patch.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Commits

  1. psql: Don't try to print a partition constraint we didn't fetch.

  2. Allow a partitioned table to have a default partition.

  3. Fix pgbench TAP tests to work with --disable-thread-safety.