]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix translatable string construction in psql
authorÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 12 Jun 2026 12:24:41 +0000 (14:24 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 12 Jun 2026 12:24:41 +0000 (14:24 +0200)
Similar to commit 3692a622d3fd, for a slightly different code pattern in
psql.

No backpatch to avoid disrupting translation in stable branches.

Author: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Peter Smith <smithpb2250@gmail.com>
Discussion: https://postgr.es/m/airjxKXx7aTG8kfE@alvherre.pgsql

src/bin/psql/describe.c

index 7f9b2b71a366b39f45c4b7bcce41fda1a23a8338..af3935b0078715a47e341630f652131798ae428a 100644 (file)
@@ -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 an index AM name (eg. btree) */
+                       appendPQExpBuffer(&tmpbuf, _("%s, for table \"%s.%s\""),
+                                                         indamname, schemaname, indtable);
 
                        if (strlen(indpred))
                                appendPQExpBuffer(&tmpbuf, _(", predicate (%s)"), indpred);