Improve the method of localizing column names and other fixed strings in
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Dec 2007 21:41:47 +0000 (21:41 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 12 Dec 2007 21:41:47 +0000 (21:41 +0000)
commitc4fc600629ed5e2e85ae7a7d1276948a80b9585b
tree22604fe16caedd604d650eb3adf286882978be52
parent580f3e4ef0a3b6c463cc6ffa9703bfefd5ef3209
Improve the method of localizing column names and other fixed strings in
psql's \d commands and other uses of printQuery().  Previously we would pass
these strings through gettext() and then send them to the server as literals
in the SQL query.  But the code was not set up to handle doubling of quotes in
the strings, causing failure if a translation attempted to use the wrong kind
of quote marks, as indeed is now the case for (at least) the French
translation of \dFp.  Another hazard was that gettext() would translate to
whatever encoding was implied by the client's LC_CTYPE setting, which might be
different from the client_encoding setting, which would probably cause the
server to reject the query as mis-encoded.  The new arrangement is to send the
untranslated ASCII strings to the server, and do the translations inside
printQuery() after the query results come back.  Per report from Guillaume
Lelarge and subsequent discussion.
src/bin/psql/describe.c
src/bin/psql/large_obj.c
src/bin/psql/print.c
src/bin/psql/print.h
src/bin/psql/startup.c
src/bin/scripts/createlang.c
src/bin/scripts/droplang.c