Re: make \d pg_toast.foo show its indices ; and, \d toast show its main table ; and \d relkind=I show its partitions (and tablespace)

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: make \d pg_toast.foo show its indices ; and, \d toast show its main table ; and \d relkind=I show its partitions (and tablespace)
Date: 2019-06-23 14:25:47
Message-ID: 20190623142546.GE16019@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm continuing this thread with an additional change to slash dee for
partitioned indexes.

postgres=# \d ttz_i_idx
Partitioned index "public.ttz_i_idx"
Column | Type | Key? | Definition
--------+---------+------+------------
i | integer | yes | i
btree, for table "public.ttz"
Number of partitions: 2 (Use \d+ to list them.)

postgres=# \d+ ttz_i_idx
Partitioned index "public.ttz_i_idx"
Column | Type | Key? | Definition | Storage | Stats target
--------+---------+------+------------+---------+--------------
i | integer | yes | i | plain |
btree, for table "public.ttz"
Partitions: ttz1_i_idx,
ttz2_i_idx, PARTITIONED

Showing the list of index partitions is probably not frequently useful, but
consider the case of non-default names, for example due to truncation.

I didn't update regression output; note that this patch also, by chance, causes
tablespace of partitioned indexes to be output, which I think is good and an
oversight that it isn't currently shown.

I added CF entry and including previous two patches for CFBOT purposes.

Recap: Tom, Andreas, Robert, Stephen and I agree that \d toast should show the
main table. Rafia and Alvaro think that \d on the main table should (also?)
show its toast.

Justin

Attachment Content-Type Size
v3-0000-print-table-associated-with-given-TOAST-table.patch text/x-diff 1.3 KB
v3-0001-make-d-pg_toast.foo-show-its-indices.patch text/x-diff 808 bytes
v3-0002-show-childs-of-partitioned-indices.patch text/x-diff 3.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-06-23 17:21:02 Re: check_recovery_target_lsn() does a PG_CATCH without a throw
Previous Message Michael Paquier 2019-06-23 13:29:25 Re: New vacuum option to do only freezing