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

2019-07-23 Thread Fabien COELHO
Pushed with minor fiddling with the toast-table code, and rather more significant hacking on the partitioned-index code. Notably, 0003 had broken output of Tablespace: footers for everything except indexes. Argh, sorry for the review miss. It's possibly not Justin's fault that that wasn't

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

2019-07-23 Thread Tom Lane
Fabien COELHO writes: > Field relnamespace oid in pg_class appears with pg 7.3, maybe it would be > appropriate to guard agains older versions, with "pset.sversion >= 70300". > It seems that there are other unguarded instances in "describe.c", so > maybe this is considered too old. Per the com

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

2019-07-23 Thread Fabien COELHO
Find attached updated patches which also work against old servers. I can't check that for sure. * About toast table addition v7: Patch applies cleanly, compiles, make check ok, no doc. This addition show the main table of a toast table, which is useful. Field relnamespace oid in pg_class

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

2019-07-16 Thread Justin Pryzby
pg_toast.pg_toast_2619 -- 2.7.4 >From e862e90f9ab0504d43728df93ed589b52786e29b Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Fri, 3 May 2019 09:24:51 -0500 Subject: [PATCH v7] make \d pg_toast.foo show its indices --- src/bin/psql/describe.c| 1 + src/test/regress/exp

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

2019-07-16 Thread Justin Pryzby
ustin Pryzby Date: Fri, 3 May 2019 09:24:51 -0500 Subject: [PATCH v5] make \d pg_toast.foo show its indices --- src/bin/psql/describe.c| 1 + src/test/regress/expected/psql.out | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 13ed2

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)

2019-07-15 Thread Justin Pryzby
44 --- a/src/test/regress/sql/psql.sql +++ b/src/test/regress/sql/psql.sql @@ -1131,3 +1131,6 @@ set search_path to default; set role to default; drop role regress_partitioning_role; + +-- slash dee on toast table: +\d pg_toast.pg_toast_2619 -- 2.7.4 >From 38928b346dc2cc264bb2a7581f1214f14b1bb89a Mo

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)

2019-06-30 Thread Fabien COELHO
There are 3 independent patches associated to one thread and one CF entry. *** About toast table v3: Patch applies cleanly, compiles, works for me. ISTM that the he query should be unambiguous: pg_catalog.pg_class instead of pg_class, add an alias (eg c), use c.FIELD to access an attribute.

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)

2019-06-27 Thread Justin Pryzby
Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Fri, 3 May 2019 09:24:51 -0500 Subject: [PATCH v3] make \d pg_toast.foo show its indices --- src/bin/psql/describe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index af2f440..c65bc

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)

2019-06-23 Thread Justin Pryzby
on key information */ -- 2.7.4 >From 185d8723bec45824a0db245f69e948080b7fbbb2 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Fri, 3 May 2019 09:24:51 -0500 Subject: [PATCH v3] make \d pg_toast.foo show its indices --- src/bin/psql/describe.c | 1 + 1 file changed, 1 insertion(+)

Re: make \d pg_toast.foo show its indices

2019-05-08 Thread Tom Lane
Robert Haas writes: > I think it's unjustifiable to show this in \d output. But maybe in > \d+ output it could be justified, or perhaps in the \d++ which I seem > to recall Alvaro proposing someplace recently. Yeah, if we're going to do that (show a table's toast table) I would want to bury it i

Re: make \d pg_toast.foo show its indices

2019-05-08 Thread Robert Haas
On Tue, May 7, 2019 at 6:03 PM Stephen Frost wrote: > Alright, maybe I'm not the best representation of our user base, but I > sure type 'select oid,* from pg_class where relname = ...' with some > regularity, mostly to get the oid to then go do something else. Having > the relfilenode would be n

Re: make \d pg_toast.foo show its indices

2019-05-07 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > Having our test framework deny us useful features just strikes me as > > bizarre. > > This is presuming that it's useful, which is debatable IMO. > I think most people will find it useless noise almost all of the time.

Re: make \d pg_toast.foo show its indices

2019-05-07 Thread Tom Lane
Stephen Frost writes: > Having our test framework deny us useful features just strikes me as > bizarre. This is presuming that it's useful, which is debatable IMO. I think most people will find it useless noise almost all of the time. regards, tom lane

Re: make \d pg_toast.foo show its indices

2019-05-07 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Tue, May 7, 2019 at 11:30 AM Stephen Frost wrote: > > > Not unless you want to break every regression test that uses \d. > > > Instability of the output is also a reason not to show the > > > toast table's name in the parent's \d[+]. >

Re: make \d pg_toast.foo show its indices

2019-05-07 Thread Robert Haas
On Tue, May 7, 2019 at 11:30 AM Stephen Frost wrote: > > Not unless you want to break every regression test that uses \d. > > Instability of the output is also a reason not to show the > > toast table's name in the parent's \d[+]. > > So we need a way to turn it off. That doesn't seem like it'd b

Re: make \d pg_toast.foo show its indices

2019-05-07 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > >> Rafia Sabih writes: > >>> IMHO, what makes more sense is to show the name of associated toast > >>> table in the \dt+ of the normal table. > > >> I'm not for that: it's usel

Re: make \d pg_toast.foo show its indices

2019-05-07 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> Rafia Sabih writes: >>> IMHO, what makes more sense is to show the name of associated toast >>> table in the \dt+ of the normal table. >> I'm not for that: it's useless information in at least 99.44% of cases. > I don't think I'd

Re: make \d pg_toast.foo show its indices

2019-05-07 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Rafia Sabih writes: > > On Fri, 3 May 2019 at 16:27, Justin Pryzby wrote: > >> Thanks - what about also showing the associated non-toast table ? > > > IMHO, what makes more sense is to show the name of associated toast > > table in the \dt+ of

Re: make \d pg_toast.foo show its indices

2019-05-06 Thread Robert Haas
On Mon, May 6, 2019 at 12:26 PM Andres Freund wrote: > I'm not convinced by that. I've certainly many a time wrote queries > against pg_class to figure out which relation a toast table belongs > to. E.g. after looking at the largest relations in the system, looking > at pg_stat_*_tables, after see

Re: make \d pg_toast.foo show its indices ; and, \d toast show its main table

2019-05-06 Thread Alvaro Herrera
On 2019-May-06, Justin Pryzby wrote: > Perhaps ... but TOAST is an implementation detail, and I think it should > rarely > be important to know the toast table for a given table. I'm with Andres -- while it's admittedly a rare need, it is a real one. Sometimes I wish for \d++ which would displa

Re: make \d pg_toast.foo show its indices

2019-05-06 Thread Andres Freund
Hi, On 2019-05-06 11:58:18 -0400, Tom Lane wrote: > Not sure though --- generally, if you're looking at a specific > toast table, you already know which table is its parent. But > maybe confirmation is a good thing. I'm not convinced by that. I've certainly many a time wrote queries against pg_c

Re: make \d pg_toast.foo show its indices ; and, \d toast show its main table

2019-05-06 Thread Justin Pryzby
On Mon, May 06, 2019 at 09:13:52AM +0200, Rafia Sabih wrote: > On Fri, 3 May 2019 at 16:27, Justin Pryzby wrote: > > > > On Fri, May 03, 2019 at 02:55:47PM +0200, Rafia Sabih wrote: > > > On Mon, 22 Apr 2019 at 17:49, Justin Pryzby wrote: > > > > > > > > It's deliberate that \dt doesn't show toas

Re: make \d pg_toast.foo show its indices

2019-05-06 Thread Tom Lane
Rafia Sabih writes: > On Fri, 3 May 2019 at 16:27, Justin Pryzby wrote: >> Thanks - what about also showing the associated non-toast table ? > IMHO, what makes more sense is to show the name of associated toast > table in the \dt+ of the normal table. I'm not for that: it's useless information

Re: make \d pg_toast.foo show its indices

2019-05-06 Thread Rafia Sabih
On Fri, 3 May 2019 at 16:27, Justin Pryzby wrote: > > On Fri, May 03, 2019 at 02:55:47PM +0200, Rafia Sabih wrote: > > On Mon, 22 Apr 2019 at 17:49, Justin Pryzby wrote: > > > > > > It's deliberate that \dt doesn't show toast tables. > > > \d shows them, but doesn't show their indices. > > > > >

Re: make \d pg_toast.foo show its indices

2019-05-03 Thread Justin Pryzby
displayed differently, perhaps in the header, but I think this is more consistent with other display. Justin >From 7c15ebe408cc5f2af51120ea152e7997ee768f81 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Fri, 3 May 2019 09:24:51 -0500 Subject: [PATCH v2 1/2] make \d pg_toast.foo show its indi

Re: make \d pg_toast.foo show its indices

2019-05-03 Thread Rafia Sabih
On Mon, 22 Apr 2019 at 17:49, Justin Pryzby 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_toa

make \d pg_toast.foo show its indices

2019-04-22 Thread Justin Pryzby
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