pg_clean_ascii(): escape bytes rather than lose them
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 13 Sep 2022 14:10:44 +0000 (16:10 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 13 Sep 2022 14:10:44 +0000 (16:10 +0200)
commit45b1a67a0fcb3f1588df596431871de4c93cb76f
tree4bb98640fe0cfda9abc5e656c7c2ad7abec610e1
parentda5d4ea5aaac4fc02f2e2aec272efe438dd4e171
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: https://www.postgresql.org/message-id/CAAWbhmgsvHrH9wLU2kYc3pOi1KSenHSLAHBbCVmmddW6-mc_=w@mail.gmail.com
src/backend/postmaster/postmaster.c
src/backend/utils/misc/guc.c
src/common/string.c
src/include/common/string.h