Skip to content

Commit fa28f9c

Browse files
committed
Fix translatability markings in psql, and add defenses against future bugs.
Several previous commits have added columns to various \d queries without updating their translate_columns[] arrays, leading to potentially incorrect translations in NLS-enabled builds. Offenders include commit 8936867 (added prosecdef to \df+), c9ac00e (added description to \dc+) and 3b17efd (added description to \dC+). Fix those cases back to 9.3 or 9.2 as appropriate. Since this is evidently more easily missed than one would like, in HEAD also add an Assert that the supplied array is long enough. This requires an API change for printQuery(), so it seems inappropriate for back branches, but presumably all future changes will be tested in HEAD anyway. In HEAD and 9.3, also clean up a whole lot of sloppiness in the emitted SQL for \dy (event triggers): lack of translatability due to failing to pass words-to-be-translated through gettext_noop(), inadequate schema qualification, and sloppy formatting resulting in unnecessarily ugly -E output. Peter Eisentraut and Tom Lane, per bug #8702 from Sergey Burladyan
1 parent 119a598 commit fa28f9c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bin/psql/describe.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,7 +2895,8 @@ listConversions(const char *pattern, bool verbose, bool showSystem)
28952895
PQExpBufferData buf;
28962896
PGresult *res;
28972897
printQueryOpt myopt = pset.popt;
2898-
static const bool translate_columns[] = {false, false, false, false, true};
2898+
static const bool translate_columns[] =
2899+
{false, false, false, false, true, false};
28992900

29002901
initPQExpBuffer(&buf);
29012902

@@ -2969,7 +2970,7 @@ listCasts(const char *pattern, bool verbose)
29692970
PQExpBufferData buf;
29702971
PGresult *res;
29712972
printQueryOpt myopt = pset.popt;
2972-
static const bool translate_columns[] = {false, false, false, true};
2973+
static const bool translate_columns[] = {false, false, false, true, false};
29732974

29742975
initPQExpBuffer(&buf);
29752976

0 commit comments

Comments
 (0)