diff options
author | Tom Lane | 2014-01-04 21:05:16 +0000 |
---|---|---|
committer | Tom Lane | 2014-01-04 21:05:16 +0000 |
commit | 92459e7a7f87f91fc3012bea9eef870cf464d91f (patch) | |
tree | f5f9350ef36bbf4a2d380904a2f379544ed1f947 /src/bin/psql/print.h | |
parent | 5858cf8ab2c7a186fab050725992d6ef640e38a5 (diff) |
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 893686762
(added prosecdef to \df+), c9ac00e6e (added description to \dc+) and
3b17efdfd (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
Diffstat (limited to 'src/bin/psql/print.h')
-rw-r--r-- | src/bin/psql/print.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h index 9cfa3b6a417..41ba7989858 100644 --- a/src/bin/psql/print.h +++ b/src/bin/psql/print.h @@ -146,6 +146,7 @@ typedef struct printQueryOpt bool translate_header; /* do gettext on column headers */ const bool *translate_columns; /* translate_columns[i-1] => do * gettext on col i */ + int n_translate_columns; /* length of translate_columns[] */ } printQueryOpt; |