Re: make \d pg_toast.foo show its indices

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
Date: 2019-05-03 14:27:22
Message-ID: 20190503142721.GC3925@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 03, 2019 at 02:55:47PM +0200, Rafia Sabih wrote:
> On Mon, 22 Apr 2019 at 17:49, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
> >
> > It's deliberate that \dt doesn't show toast tables.
> > \d shows them, but doesn't show their indices.
> >
> > It seems to me that their indices should be shown, without having to think and
> > know to query pg_index.
> >
> > postgres=# \d pg_toast.pg_toast_2600
> > TOAST table "pg_toast.pg_toast_2600"
> > Column | Type
> > ------------+---------
> > chunk_id | oid
> > chunk_seq | integer
> > chunk_data | bytea
> > Indexes:
> > "pg_toast_2600_index" PRIMARY KEY, btree (chunk_id, chunk_seq)
>
> +1.

Thanks - what about also showing the associated non-toast table ?

postgres=# \d pg_toast.pg_toast_2620
TOAST table "pg_toast.pg_toast_2620"
Column | Type
------------+---------
chunk_id | oid
chunk_seq | integer
chunk_data | bytea
FOR TABLE: "pg_catalog.pg_trigger"
Indexes:
"pg_toast_2620_index" PRIMARY KEY, btree (chunk_id, chunk_seq)

That could be displayed differently, perhaps in the header, but I think this is
more consistent with other display.

Justin

Attachment Content-Type Size
v2-0001-make-d-pg_toast.foo-show-its-indices.patch text/x-diff 812 bytes
v2-0002-print-table-associated-with-given-TOAST-table.patch text/x-diff 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-05-03 15:06:58 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Stephen Frost 2019-05-03 13:31:54 Re: Google Season of Docs 2019 - Starter