pgsql: pg_clean_ascii(): escape bytes rather than lose them

Started by Peter Eisentrautalmost 4 years ago1 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

pg_clean_ascii(): escape bytes rather than lose them

Rather than replace each unprintable byte with a '?' character, replace
it with a hex escape instead. The API now allocates a copy rather than
modifying the input in place.

Author: Jacob Champion <jchampion@timescale.com>
Discussion: /messages/by-id/CAAWbhmgsvHrH9wLU2kYc3pOi1KSenHSLAHBbCVmmddW6-mc_=w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/45b1a67a0fcb3f1588df596431871de4c93cb76f

Modified Files
--------------
src/backend/postmaster/postmaster.c | 6 +----
src/backend/utils/misc/guc.c | 22 ++++++++++++++--
src/common/string.c | 52 ++++++++++++++++++++++++++++++-------
src/include/common/string.h | 2 +-
4 files changed, 65 insertions(+), 17 deletions(-)