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

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_clean_ascii(): escape bytes rather than lose them
Date: 2022-09-13 14:11:08
Message-ID: E1oY6d2-000AWg-3g@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)timescale(dot)com>
Discussion: https://www.postgresql.org/message-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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2022-09-13 15:13:17 pgsql: Split up guc.c for better build speed and ease of maintenance.
Previous Message Peter Eisentraut 2022-09-13 12:39:27 pgsql: Make locale option behavior more consistent