pgsql: Fix translation of special characters in psql's LaTeX outputmod - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix translation of special characters in psql's LaTeX outputmod
Date
Msg-id E1gRPRF-0004MZ-S9@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix translation of special characters in psql's LaTeX output modes.

latex_escaped_print() mistranslated \ and failed to provide any translation
for # ^ and ~, all of which would typically lead to LaTeX document syntax
errors.  In addition it didn't translate < > and |, which would typically
render as unexpected characters.

To some extent this represents shortcomings in ancient versions of LaTeX,
which if memory serves had no easy way to render these control characters
as ASCII text.  But that's been fixed for, um, decades.  In any case there
is no value in emitting guaranteed-to-fail output for these characters.

Noted while fooling with test cases added by commit 9a98984f4.  Back-patch
the code change to all supported versions.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/70d7e507ef9d380bd46345e984f069207de5e24e

Modified Files
--------------
src/fe_utils/print.c               |  36 ++++++++--
src/test/regress/expected/psql.out | 132 ++++++++++++++++++-------------------
src/test/regress/sql/psql.sql      |   4 +-
3 files changed, 98 insertions(+), 74 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Avoid locale-dependent output in numericlocale check.
Next
From: Andres Freund
Date:
Subject: pgsql: Fix pg_upgrade for oid removal.