Re: allow to \dtS+ pg_toast.*

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: allow to \dtS+ pg_toast.*
Дата
Msg-id c3fdffcfd26f4d433307fa80f6ef7f0b3b183f06.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: allow to \dtS+ pg_toast.*  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: allow to \dtS+ pg_toast.*  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
On Fri, 2020-12-18 at 00:58 -0600, Justin Pryzby wrote:
> On Thu, Dec 17, 2020 at 04:16:52PM +0100, Laurenz Albe wrote:
> > On Mon, 2020-11-30 at 10:54 -0600, Justin Pryzby wrote:
> > > This makes toast tables a bit less special and easier to inspect.
> > > 
> > > postgres=# \dtS+ pg_toast.pg_toast_2619
> > >  pg_toast | pg_toast_2619 | toast table | pryzbyj | permanent   | heap          | 56 kB | 
> > > 
> > > This follows commit from last year:
> > > | eb5472da9 make \d pg_toast.foo show its indices ; and, \d toast show its main table
> > 
> > This would indeed be convenient.
> > 
> > While playing around with it, I found the following oddity:
> > 
> > regression=# \dtS pg_toast.pg_toast_30701
> >  pg_toast | pg_toast_30701 | toast table | laurenz
> > 
> > regression=# \dt pg_toast.pg_toast_30701
> > Did not find any relation named "pg_toast.pg_toast_30701".
> > 
> > Now this doesn't seem right.  To my understanding, \dtS should do the same as \dt,
> > except that it should also search in "pg_catalog" if no schema was provided.
> 
> You mean that if pg_toast.* should be shown if a matching "pattern" is given,
> even if "S" was not used.  I think you're right.  The behavior I implemented
> was intended to provide a bit of historic compatibility towards hiding toast
> tables, but I think it's not needed, since they're not shown anyway unless
> someone includes "S", specifies the "pg_toast." schema, or pg_toast is in their
> search path.  See attached.

Yes, exactly.

I wonder why the modification in "listPartitionedTables" is necessary.
Surely there cannot be any partitioned toast tables, can there?

> > Another thing that is missing is tab completion for
> > regression=# \dtS pg_toast.pg_
> > This should work just like for \d and \dS.
> 
> Tom objected to this in the past, humorously to me:
> 
> https://www.postgresql.org/message-id/14255.1536781029@sss.pgh.pa.us

That was about VACUUM and ANALYZE, and I certainly see the point
that this is not a frequent enough use case to warrant guiding
people there with tab completion.

But I don't take that as an argument against tab completion in our case.
If I want to know how big the TOAST table of relation 87654 is,
I think it is convenient if I can tab to

\dt+ pg_toast.pg_toast_

If you want to abolish special treatment for TOAST tables in \dt(S),
go all the way.

Yours,
Laurenz Albe




В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Hou, Zhijie"
Дата:
Сообщение: RE: postgres_fdw - cached connection leaks if the associated user mapping/foreign server is dropped
Следующее
От: Konstantin Knizhnik
Дата:
Сообщение: Double partition lock in bufmgr