pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Show more-intuitive titles for psql commands \dt, \di, etc.
Date: Wed, 05 Feb 2025 17:46:03 +0000
Message-ID: <E1tfjTO-005Xev-Q9@gemulon.postgresql.org> (raw)

Show more-intuitive titles for psql commands \dt, \di, etc.

If exactly one relation type is requested in a command of the \dtisv
family, say "tables", "indexes", etc instead of "relations".  This
should cover the majority of actual uses, without creating a huge
number of new translatable strings.  The error messages for no
matching relations are adjusted as well.

In passing, invent "pg_log_error_internal()" to be used for frontend
error messages that don't seem to need translation, analogously to
errmsg_internal() in the backend.  The implementation is a bit cheesy,
being just a macro to prevent xgettext from recognizing a trigger
keyword.  This won't avoid a useless gettext lookup cycle at runtime
--- but surely we don't care about an extra microsecond or two in
what's supposed to be a can't-happen case.  I (tgl) also made
"pg_fatal_internal()", though it's not used in this patch.

Author: Greg Sabino Mullane <htamfids@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAKAnmm+7o93fQV-RFkGaN1QnP-0D4d3JTykD+cLueqjDMKdfag@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a14707da564e8c94bd123f0e3a75e194fd7ef56a

Modified Files
--------------
src/bin/psql/describe.c                  | 65 +++++++++++++++++++++++++++++---
src/include/common/logging.h             |  7 ++++
src/test/regress/expected/dependency.out |  2 +-
src/test/regress/expected/psql.out       | 42 ++++++++++-----------
4 files changed, 88 insertions(+), 28 deletions(-)



Message-ID: <E1tfjTO-005Xev-Q9@gemulon.postgresql.org>
Permalink:  ../E1tfjTO-005Xev-Q9@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tfjTO-005Xev-Q9@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Show more-intuitive titles for psql commands \dt, \di, etc.
  In-Reply-To: <E1tfjTO-005Xev-Q9@gemulon.postgresql.org>

* 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