pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Euler Taveira <euler@timbira.com.br>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: psql \d for wide tables / pattern for individual columns
Date: Mon, 11 Nov 2019 10:46:07 -0500
Message-ID: <1492.1573487167@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHE3wggcZWXgdjwN0HoH8oevq0x_N7ybdoRn29ns6w-Qr2N7KA@mail.gmail.com>
References: <20191110212928.GQ4999@telsasoft.com>
	<CAHE3wggcZWXgdjwN0HoH8oevq0x_N7ybdoRn29ns6w-Qr2N7KA@mail.gmail.com>

Euler Taveira <euler@timbira.com.br> writes:
> Em dom., 10 de nov. de 2019 às 18:29, Justin Pryzby
> <pryzby@telsasoft.com> escreveu:
>> We have some very wide tables (historically, up to 1600 columns ; this is
>> improved now, but sometimes still several hundred, with numerous pages output
>> to psql pager).  Is is reasonable to suggest adding a psql command to show a
>> table's definition, without all the columns listed?

> It seems a good idea. However, I'm afraid adding a second argument
> could limit our capabilities to match/suppress other table properties
> in the future.

Yeah, that was my immediate reaction to the proposed syntax as well.
I think we'd better make sure that we aren't foreclosing future
extensions of \d.

Maybe a reasonable idea is to expect that any additional arguments
are in "keyword=value" style, so that the immediate need could be
met with

\d mytable columns=<pattern>

It might already be worthwhile to allow both positive and negative
patterns, so also

\d mytable exclude_columns=<pattern>

> The problem with your proposal is that I can't differentiate a
> complete output from another suppress-some-columns output if you don't
> provide the meta-command. I think you should explicitly show that some
> columns were suppressed (something like "... suppressed columns..."
> after the list of matched columns). If you don't, it could lead to
> confusion while reporting table description.

Hm ... "N columns suppressed" might sometimes be useful, but I'm afraid
it would take an extra query to get it, and I'm not sure it's worth it.
I think someone who's using these options would already know perfectly
well what they're hiding.  We don't expect, say, "\dt my*" to tell you
how many tables it didn't list.

			regards, tom lane





view thread (3+ messages)

Message-ID: <1492.1573487167@sss.pgh.pa.us>
Permalink:  ../1492.1573487167@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1492.1573487167@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, euler@timbira.com.br, pryzby@telsasoft.com
  Subject: Re: psql \d for wide tables / pattern for individual columns
  In-Reply-To: <1492.1573487167@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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