pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedmake \d pg_toast.foo show its indices
19+ messages / 7 participants
[nested] [flat]
* make \d pg_toast.foo show its indices
@ 2019-04-22 15:49 Justin Pryzby <pryzby@telsasoft.com>
0 siblings, 1 reply; 19+ messages in thread
From: Justin Pryzby @ 2019-04-22 15:49 UTC (permalink / raw)
To: pgsql-hackers
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)
Justin
Attachments:
[text/x-diff] slash-d-show-indices-on-toast.patch (517B, ../../20190422154902.GH14223@telsasoft.com/2-slash-d-show-indices-on-toast.patch)
download | inline diff:
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index d7390d5..d26d986 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2274,6 +2274,7 @@ describeOneTableDetails(const char *schemaname,
else if (tableinfo.relkind == RELKIND_RELATION ||
tableinfo.relkind == RELKIND_MATVIEW ||
tableinfo.relkind == RELKIND_FOREIGN_TABLE ||
+ tableinfo.relkind == RELKIND_TOASTVALUE ||
tableinfo.relkind == RELKIND_PARTITIONED_TABLE)
{
/* Footer information about a table */
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-03 12:55 Rafia Sabih <rafia.pghackers@gmail.com>
parent: Justin Pryzby <pryzby@telsasoft.com>
0 siblings, 1 reply; 19+ messages in thread
From: Rafia Sabih @ 2019-05-03 12:55 UTC (permalink / raw)
To: Justin Pryzby <pryzby@telsasoft.com>; +Cc: pgsql-hackers
On Mon, 22 Apr 2019 at 17:49, Justin Pryzby <pryzby@telsasoft.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.
--
Regards,
Rafia Sabih
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v5] make \d pg_toast.foo show its indices
@ 2019-05-03 14:24 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2019-05-03 14:24 UTC (permalink / raw)
---
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 13ed2e1..86a7610 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2303,6 +2303,7 @@ describeOneTableDetails(const char *schemaname,
else if (tableinfo.relkind == RELKIND_RELATION ||
tableinfo.relkind == RELKIND_MATVIEW ||
tableinfo.relkind == RELKIND_FOREIGN_TABLE ||
+ tableinfo.relkind == RELKIND_TOASTVALUE ||
tableinfo.relkind == RELKIND_PARTITIONED_TABLE)
{
/* Footer information about a table */
diff --git a/src/test/regress/expected/psql.out b/src/test/regress/expected/psql.out
index 5c8e439..d53dbb0 100644
--- a/src/test/regress/expected/psql.out
+++ b/src/test/regress/expected/psql.out
@@ -4757,4 +4757,6 @@ TOAST table "pg_toast.pg_toast_2619"
chunk_seq | integer
chunk_data | bytea
For table: "pg_catalog.pg_statistic"
+Indexes:
+ "pg_toast_2619_index" PRIMARY KEY, btree (chunk_id, chunk_seq)
--
2.7.4
--Qxx1br4bt0+wmkIi
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v6-0003-show-childs-of-partitioned-indices.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v7] make \d pg_toast.foo show its indices
@ 2019-05-03 14:24 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2019-05-03 14:24 UTC (permalink / raw)
---
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 9cd2e7d..b3b94d1 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2304,6 +2304,7 @@ describeOneTableDetails(const char *schemaname,
else if (tableinfo.relkind == RELKIND_RELATION ||
tableinfo.relkind == RELKIND_MATVIEW ||
tableinfo.relkind == RELKIND_FOREIGN_TABLE ||
+ tableinfo.relkind == RELKIND_TOASTVALUE ||
tableinfo.relkind == RELKIND_PARTITIONED_TABLE)
{
/* Footer information about a table */
diff --git a/src/test/regress/expected/psql.out b/src/test/regress/expected/psql.out
index 5c8e439..d53dbb0 100644
--- a/src/test/regress/expected/psql.out
+++ b/src/test/regress/expected/psql.out
@@ -4757,4 +4757,6 @@ TOAST table "pg_toast.pg_toast_2619"
chunk_seq | integer
chunk_data | bytea
For table: "pg_catalog.pg_statistic"
+Indexes:
+ "pg_toast_2619_index" PRIMARY KEY, btree (chunk_id, chunk_seq)
--
2.7.4
--ryJZkp9/svQ58syV
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v7-0003-show-childs-of-partitioned-indices.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* [PATCH v3] make \d pg_toast.foo show its indices
@ 2019-05-03 14:24 Justin Pryzby <pryzbyj@telsasoft.com>
0 siblings, 0 replies; 19+ messages in thread
From: Justin Pryzby @ 2019-05-03 14:24 UTC (permalink / raw)
---
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..c65bc82 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2275,6 +2275,7 @@ describeOneTableDetails(const char *schemaname,
else if (tableinfo.relkind == RELKIND_RELATION ||
tableinfo.relkind == RELKIND_MATVIEW ||
tableinfo.relkind == RELKIND_FOREIGN_TABLE ||
+ tableinfo.relkind == RELKIND_TOASTVALUE ||
tableinfo.relkind == RELKIND_PARTITIONED_TABLE)
{
/* Footer information about a table */
--
2.7.4
--AqsLC8rIMeq19msA
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v4-0002-show-childs-and-tablespaces-of-partitioned-indice.patch"
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-03 14:27 Justin Pryzby <pryzby@telsasoft.com>
parent: Rafia Sabih <rafia.pghackers@gmail.com>
0 siblings, 1 reply; 19+ messages in thread
From: Justin Pryzby @ 2019-05-03 14:27 UTC (permalink / raw)
To: Rafia Sabih <rafia.pghackers@gmail.com>; +Cc: 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@telsasoft.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
Attachments:
[text/x-diff] v2-0001-make-d-pg_toast.foo-show-its-indices.patch (810B, ../../20190503142721.GC3925@telsasoft.com/2-v2-0001-make-d-pg_toast.foo-show-its-indices.patch)
download | inline diff:
From 7c15ebe408cc5f2af51120ea152e7997ee768f81 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Fri, 3 May 2019 09:24:51 -0500
Subject: [PATCH v2 1/2] 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 d7390d5..d26d986 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2274,6 +2274,7 @@ describeOneTableDetails(const char *schemaname,
else if (tableinfo.relkind == RELKIND_RELATION ||
tableinfo.relkind == RELKIND_MATVIEW ||
tableinfo.relkind == RELKIND_FOREIGN_TABLE ||
+ tableinfo.relkind == RELKIND_TOASTVALUE ||
tableinfo.relkind == RELKIND_PARTITIONED_TABLE)
{
/* Footer information about a table */
--
2.7.4
[text/x-diff] v2-0002-print-table-associated-with-given-TOAST-table.patch (1.3K, ../../20190503142721.GC3925@telsasoft.com/3-v2-0002-print-table-associated-with-given-TOAST-table.patch)
download | inline diff:
From 38f50cdb727c67ae7aece8e85caf2960e824cb65 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 30 Apr 2019 19:05:53 -0500
Subject: [PATCH v2 2/2] print table associated with given TOAST table
---
src/bin/psql/describe.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index d26d986..ebdf18a 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2152,6 +2152,28 @@ describeOneTableDetails(const char *schemaname,
}
}
+ /* print table associated with given TOAST table */
+ if (tableinfo.relkind == RELKIND_TOASTVALUE)
+ {
+ PGresult *result = NULL;
+ printfPQExpBuffer(&buf,
+ "SELECT relnamespace::pg_catalog.regnamespace, relname FROM pg_class WHERE reltoastrelid = '%s'",
+ oid);
+ result = PSQLexec(buf.data);
+ if (!result) {
+ goto error_return;
+ } else if (1 != PQntuples(result)) {
+ PQclear(result);
+ goto error_return;
+ } else {
+ char *schemaname = PQgetvalue(result, 0, 0);
+ char *relname = PQgetvalue(result, 0, 1);
+ appendPQExpBuffer(&tmpbuf, _("For table: \"%s.%s\""),
+ schemaname, relname);
+ printTableAddFooter(&cont, tmpbuf.data);
+ }
+ }
+
if (tableinfo.relkind == RELKIND_PARTITIONED_TABLE)
{
/* Get the partition key information */
--
2.7.4
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-06 07:13 Rafia Sabih <rafia.pghackers@gmail.com>
parent: Justin Pryzby <pryzby@telsasoft.com>
0 siblings, 1 reply; 19+ messages in thread
From: Rafia Sabih @ 2019-05-06 07:13 UTC (permalink / raw)
To: Justin Pryzby <pryzby@telsasoft.com>; +Cc: pgsql-hackers
On Fri, 3 May 2019 at 16:27, Justin Pryzby <pryzby@telsasoft.com> wrote:
>
> On Fri, May 03, 2019 at 02:55:47PM +0200, Rafia Sabih wrote:
> > On Mon, 22 Apr 2019 at 17:49, Justin Pryzby <pryzby@telsasoft.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 ?
>
IMHO, what makes more sense is to show the name of associated toast
table in the \dt+ of the normal table.
--
Regards,
Rafia Sabih
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-06 15:58 Tom Lane <tgl@sss.pgh.pa.us>
parent: Rafia Sabih <rafia.pghackers@gmail.com>
0 siblings, 2 replies; 19+ messages in thread
From: Tom Lane @ 2019-05-06 15:58 UTC (permalink / raw)
To: Rafia Sabih <rafia.pghackers@gmail.com>; +Cc: Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
Rafia Sabih <rafia.pghackers@gmail.com> writes:
> On Fri, 3 May 2019 at 16:27, Justin Pryzby <pryzby@telsasoft.com> 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 in at least 99.44% of cases.
Possibly it is useful in the other direction as Justin suggests.
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.
That seems off-topic for this thread though. I agree with the
stated premise that \d on a toast table should show all the same
information \d on a regular table would.
regards, tom lane
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-06 16:26 Andres Freund <andres@anarazel.de>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 19+ messages in thread
From: Andres Freund @ 2019-05-06 16:26 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
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_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 seeing an error in the logs, etc.
> That seems off-topic for this thread though. I agree with the
> stated premise that \d on a toast table should show all the same
> information \d on a regular table would.
+1
Greetings,
Andres Freund
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-06 17:52 Robert Haas <robertmhaas@gmail.com>
parent: Andres Freund <andres@anarazel.de>
0 siblings, 0 replies; 19+ messages in thread
From: Robert Haas @ 2019-05-06 17:52 UTC (permalink / raw)
To: Andres Freund <andres@anarazel.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
On Mon, May 6, 2019 at 12:26 PM Andres Freund <andres@anarazel.de> 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 seeing an error in the logs, etc.
+1. I think it would be great for \d on the TOAST table to show this
information.
> > That seems off-topic for this thread though. I agree with the
> > stated premise that \d on a toast table should show all the same
> > information \d on a regular table would.
>
> +1
That premise seems like a good one, too.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-07 15:16 Stephen Frost <sfrost@snowman.net>
parent: Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 19+ messages in thread
From: Stephen Frost @ 2019-05-07 15:16 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
Greetings,
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Rafia Sabih <rafia.pghackers@gmail.com> writes:
> > On Fri, 3 May 2019 at 16:27, Justin Pryzby <pryzby@telsasoft.com> 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 in at least 99.44% of cases.
I don't think I'd put it in \dt+, but the toast table is still
pg_toast.pg_toast_{relOid}, right? What about showing the OID of the
table in the \d output, eg:
=> \d comments
Table "public.comments" (50788)
Column | Type | Collation | Nullable | Default
etc?
> Possibly it is useful in the other direction as Justin suggests.
> 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.
As mentioned elsewhere, there are certainly times when you don't know
that info and if you're looking at the definition of a TOAST table,
which isn't terribly complex, it seems like a good idea to go ahead and
include the table it's the TOAST table for.
> That seems off-topic for this thread though. I agree with the
> stated premise that \d on a toast table should show all the same
> information \d on a regular table would.
+1
Thanks!
Stephen
Attachments:
[application/pgp-signature] signature.asc (818B, ../../20190507151600.GH6197@tamriel.snowman.net/2-signature.asc)
download
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-07 15:24 Tom Lane <tgl@sss.pgh.pa.us>
parent: Stephen Frost <sfrost@snowman.net>
0 siblings, 1 reply; 19+ messages in thread
From: Tom Lane @ 2019-05-07 15:24 UTC (permalink / raw)
To: Stephen Frost <sfrost@snowman.net>; +Cc: Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> Rafia Sabih <rafia.pghackers@gmail.com> 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 put it in \dt+, but the toast table is still
> pg_toast.pg_toast_{relOid}, right? What about showing the OID of the
> table in the \d output, eg:
> => \d comments
> Table "public.comments" (50788)
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[+].
>> Possibly it is useful in the other direction as Justin suggests.
>> 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.
> As mentioned elsewhere, there are certainly times when you don't know
> that info and if you're looking at the definition of a TOAST table,
> which isn't terribly complex, it seems like a good idea to go ahead and
> include the table it's the TOAST table for.
I'm not against putting that info into the result of \d on the toast
table.
regards, tom lane
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-07 15:30 Stephen Frost <sfrost@snowman.net>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 19+ messages in thread
From: Stephen Frost @ 2019-05-07 15:30 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
Greetings,
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> writes:
> > * Tom Lane (tgl@sss.pgh.pa.us) wrote:
> >> Rafia Sabih <rafia.pghackers@gmail.com> 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 put it in \dt+, but the toast table is still
> > pg_toast.pg_toast_{relOid}, right? What about showing the OID of the
> > table in the \d output, eg:
> > => \d comments
> > Table "public.comments" (50788)
>
> 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 be hard to
implement and the information is certainly quite useful.
Thanks,
Stephen
Attachments:
[application/pgp-signature] signature.asc (818B, ../../20190507153006.GI6197@tamriel.snowman.net/2-signature.asc)
download
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-07 20:44 Robert Haas <robertmhaas@gmail.com>
parent: Stephen Frost <sfrost@snowman.net>
0 siblings, 1 reply; 19+ messages in thread
From: Robert Haas @ 2019-05-07 20:44 UTC (permalink / raw)
To: Stephen Frost <sfrost@snowman.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
On Tue, May 7, 2019 at 11:30 AM Stephen Frost <sfrost@snowman.net> 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 be hard to
> implement and the information is certainly quite useful.
Ugh. It's not really worth it if we have to go to such lengths.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-07 20:48 Stephen Frost <sfrost@snowman.net>
parent: Robert Haas <robertmhaas@gmail.com>
0 siblings, 1 reply; 19+ messages in thread
From: Stephen Frost @ 2019-05-07 20:48 UTC (permalink / raw)
To: Robert Haas <robertmhaas@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
Greetings,
* Robert Haas (robertmhaas@gmail.com) wrote:
> On Tue, May 7, 2019 at 11:30 AM Stephen Frost <sfrost@snowman.net> 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 be hard to
> > implement and the information is certainly quite useful.
>
> Ugh. It's not really worth it if we have to go to such lengths.
I don't think I agree.. We've gone to pretty great lengths to have
things that can be turned on and off for explain because they're useful
to have but not something that's predictible in the regression tests.
This doesn't strike me as all that different (indeed, if anything it
seems like it should be less of an issue since it's entirely client
side...).
Having our test framework deny us useful features just strikes me as
bizarre.
Thanks,
Stephen
Attachments:
[application/pgp-signature] signature.asc (818B, ../../20190507204809.GM6197@tamriel.snowman.net/2-signature.asc)
download
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-07 21:49 Tom Lane <tgl@sss.pgh.pa.us>
parent: Stephen Frost <sfrost@snowman.net>
0 siblings, 1 reply; 19+ messages in thread
From: Tom Lane @ 2019-05-07 21:49 UTC (permalink / raw)
To: Stephen Frost <sfrost@snowman.net>; +Cc: Robert Haas <robertmhaas@gmail.com>; Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
Stephen Frost <sfrost@snowman.net> 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
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-07 22:03 Stephen Frost <sfrost@snowman.net>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 19+ messages in thread
From: Stephen Frost @ 2019-05-07 22:03 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Robert Haas <robertmhaas@gmail.com>; Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
Greetings,
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> 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.
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 nice too, now that I think about it, and
reltuples. There's ways to get *nearly* everything that's in pg_class
and friends out of various \d incantations, but not quite everything,
which seems unfortunate.
In any case, I can understand an argument that the code it requires is
too much to maintain for a relatively minor feature (though it hardly
seems like it would be...) or that it would be confusing or unhelpful to
users (aka "noise") much of the time, so I'll leave it to others to
comment on if they think any of these ideas be a useful addition or not.
I just don't think we should be voting down a feature because it'd take
a bit of extra effort to make our regression tests work with it, which
is all I was intending to get at here.
Thanks!
Stephen
Attachments:
[application/pgp-signature] signature.asc (818B, ../../20190507220329.GN6197@tamriel.snowman.net/2-signature.asc)
download
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-08 14:18 Robert Haas <robertmhaas@gmail.com>
parent: Stephen Frost <sfrost@snowman.net>
0 siblings, 1 reply; 19+ messages in thread
From: Robert Haas @ 2019-05-08 14:18 UTC (permalink / raw)
To: Stephen Frost <sfrost@snowman.net>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
On Tue, May 7, 2019 at 6:03 PM Stephen Frost <sfrost@snowman.net> 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 nice too, now that I think about it, and
> reltuples. There's ways to get *nearly* everything that's in pg_class
> and friends out of various \d incantations, but not quite everything,
> which seems unfortunate.
>
> In any case, I can understand an argument that the code it requires is
> too much to maintain for a relatively minor feature (though it hardly
> seems like it would be...) or that it would be confusing or unhelpful to
> users (aka "noise") much of the time, so I'll leave it to others to
> comment on if they think any of these ideas be a useful addition or not.
>
> I just don't think we should be voting down a feature because it'd take
> a bit of extra effort to make our regression tests work with it, which
> is all I was intending to get at here.
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.
I think if we're going to show it, it should be on its own line, with
a clear label, not just in the table header as you proposed.
Otherwise, people won't know what it is.
I suppose the work we'd need to make it work with the regression tests
is no worse than the hide_tableam crock which Andres recently added.
That is certainly a crock, but I can testify that it's a very useful
crock for zheap development.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: make \d pg_toast.foo show its indices
@ 2019-05-08 14:28 Tom Lane <tgl@sss.pgh.pa.us>
parent: Robert Haas <robertmhaas@gmail.com>
0 siblings, 0 replies; 19+ messages in thread
From: Tom Lane @ 2019-05-08 14:28 UTC (permalink / raw)
To: Robert Haas <robertmhaas@gmail.com>; +Cc: Stephen Frost <sfrost@snowman.net>; Rafia Sabih <rafia.pghackers@gmail.com>; Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers
Robert Haas <robertmhaas@gmail.com> 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 in \d++ or some other not-currently-used notation.
regards, tom lane
^ permalink raw reply [nested|flat] 19+ messages in thread
end of thread, other threads:[~2019-05-08 14:28 UTC | newest]
Thread overview: 19+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-04-22 15:49 make \d pg_toast.foo show its indices Justin Pryzby <pryzby@telsasoft.com>
2019-05-03 12:55 ` Rafia Sabih <rafia.pghackers@gmail.com>
2019-05-03 14:27 ` Justin Pryzby <pryzby@telsasoft.com>
2019-05-06 07:13 ` Rafia Sabih <rafia.pghackers@gmail.com>
2019-05-06 15:58 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-05-06 16:26 ` Andres Freund <andres@anarazel.de>
2019-05-06 17:52 ` Robert Haas <robertmhaas@gmail.com>
2019-05-07 15:16 ` Stephen Frost <sfrost@snowman.net>
2019-05-07 15:24 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-05-07 15:30 ` Stephen Frost <sfrost@snowman.net>
2019-05-07 20:44 ` Robert Haas <robertmhaas@gmail.com>
2019-05-07 20:48 ` Stephen Frost <sfrost@snowman.net>
2019-05-07 21:49 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-05-07 22:03 ` Stephen Frost <sfrost@snowman.net>
2019-05-08 14:18 ` Robert Haas <robertmhaas@gmail.com>
2019-05-08 14:28 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-05-03 14:24 [PATCH v5] make \d pg_toast.foo show its indices Justin Pryzby <pryzbyj@telsasoft.com>
2019-05-03 14:24 [PATCH v7] make \d pg_toast.foo show its indices Justin Pryzby <pryzbyj@telsasoft.com>
2019-05-03 14:24 [PATCH v3] make \d pg_toast.foo show its indices Justin Pryzby <pryzbyj@telsasoft.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox