Re: Better title output for psql \dt \di etc. commands

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Better title output for psql \dt \di etc. commands
Date: 2025-02-03 18:07:59
Message-ID: 415618.1738606079@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Sabino Mullane <htamfids(at)gmail(dot)com> writes:
> Please find attached a patch to enable more intuitive titles when using
> psql and doing the following actions:
> \dt \di \dv \dm \ds \dE
> In other words, everything in listTables()
> We still default to "List or relations", but if we know that the user has
> requested exactly one specific type of relation, we use that
> instead.

As presented, I think this fails the translatability guideline about
"Do not construct sentences at run-time" [1]. You could get around
that by selecting one of several whole title strings, though.

For myself, if we were going to do something like this, I'd kind
of like to cover more cases:

greg=# \dti
List of tables and indexes

But I'm really not sure how to maintain translatability without
a combinatorial explosion. It's fairly easy to see how we might
produce output like

greg=# \dtvi
List of tables, views, indexes

but "List of", "tables", "views", and "indexes" would all have
to be separately translated, and I fear that might not hang
together well.

regards, tom lane

[1] https://www.postgresql.org/docs/devel/nls-programmer.html#NLS-GUIDELINES

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-02-03 18:18:10 Re: Using Expanded Objects other than Arrays from plpgsql
Previous Message Mahendra Singh Thalor 2025-02-03 18:04:39 Re: Non-text mode for pg_dumpall