Add backend-only appendStringInfoStringQuoted
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 10 Dec 2019 20:09:32 +0000 (17:09 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 10 Dec 2019 20:12:56 +0000 (17:12 -0300)
commit6cafde1bd43f1c28b044953cac2f2999eb425b22
treef08bc9618832f34f0a26192ab04014d7300e43d8
parent0da33c762b85aeada111aa1371c33ac6737f8396
Add backend-only appendStringInfoStringQuoted

This provides a mechanism to emit literal values in informative
messages, such as query parameters.  The new code is more complex than
what it replaces, primarily because it wants to be more efficient.
It also has the (currently unused) additional optional capability of
specifying a maximum size to print.

The new function lives out of common/stringinfo.c so that frontend users
of that file need not pull in unnecessary multibyte-encoding support
code.

Author: Γlvaro Herrera and Alexey Bashtanov, after a suggestion from Andres Freund
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/20190920203905.xkv5udsd5dxfs6tr@alap3.anarazel.de
src/backend/tcop/postgres.c
src/backend/utils/mb/Makefile
src/backend/utils/mb/README
src/backend/utils/mb/stringinfo_mb.c [new file with mode: 0644]
src/include/mb/stringinfo_mb.h [new file with mode: 0644]
src/pl/plpgsql/src/pl_exec.c
src/test/regress/expected/plpgsql.out
src/test/regress/sql/plpgsql.sql