On 2026-Apr-24, Peter Smith wrote:

> OK. Including the comma within a larger translated string seems like a
> better idea.
[...]
> Also, why did you choose to implement `last` versus `first` logic?
> e.g. How about this?

In the end I decided to go with the flow and changed to use "first"
logic rather than "last".  I also figured that we should change the
other two places you pointed out at the start of the thread to use the
same coding style.  Since this is mostly cosmetic, I don't feel
compelled to back-patch it, and pushed only to master.

Another place I noticed while looking this over is psql's
describeOneTableDetails(), per the attached patch.  It's essentially
more of the same, but arguably different enough that I judged it
warranted posting before pushing.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
>From d75da1c6046711ee1dedaf0bbf00c94241437630 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Herrera?= <[email protected]>
Date: Tue, 28 Apr 2026 16:03:26 +0200
Subject: [PATCH] fix some psql strings

---
 src/bin/psql/describe.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 7f9b2b71a36..757a355c063 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -2504,18 +2504,18 @@ describeOneTableDetails(const char *schemaname,
 				printfPQExpBuffer(&tmpbuf, _("primary key, "));
 			else if (strcmp(indisunique, "t") == 0)
 			{
-				printfPQExpBuffer(&tmpbuf, _("unique"));
 				if (strcmp(indnullsnotdistinct, "t") == 0)
-					appendPQExpBufferStr(&tmpbuf, _(" nulls not distinct"));
-				appendPQExpBufferStr(&tmpbuf, _(", "));
+					printfPQExpBuffer(&tmpbuf, _("unique nulls not distinct, "));
+				else
+					printfPQExpBuffer(&tmpbuf, _("unique, "));
 			}
 			else
 				resetPQExpBuffer(&tmpbuf);
-			appendPQExpBuffer(&tmpbuf, "%s, ", indamname);
 
 			/* we assume here that index and table are in same schema */
-			appendPQExpBuffer(&tmpbuf, _("for table \"%s.%s\""),
-							  schemaname, indtable);
+			/*- translator: the first %s is the index AM name */
+			appendPQExpBuffer(&tmpbuf, _("%s, for table \"%s.%s\""),
+							  indamname, schemaname, indtable);
 
 			if (strlen(indpred))
 				appendPQExpBuffer(&tmpbuf, _(", predicate (%s)"), indpred);
-- 
2.47.3

Reply via email to