pgsql: chomp PQerrorMessage() in backend uses

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: chomp PQerrorMessage() in backend uses
Date: 2017-02-27 13:58:06
Message-ID: E1ciLoU-0007qb-LB@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

chomp PQerrorMessage() in backend uses

PQerrorMessage() returns an error message with a trailing newline, but
in backend use (dblink, postgres_fdw, libpqwalreceiver), we want to have
the error message without that for emitting via ereport(). To simplify
that, add a function pchomp() that returns a pstrdup'ed string with the
trailing newline characters removed.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2ed193c904679a533d5e26a27c97119793bcae52

Modified Files
--------------
contrib/dblink/dblink.c | 14 +++++-----
contrib/dblink/expected/dblink.out | 2 --
contrib/postgres_fdw/connection.c | 14 ++--------
.../libpqwalreceiver/libpqwalreceiver.c | 30 +++++++++++-----------
src/backend/utils/mmgr/mcxt.c | 14 ++++++++++
src/include/utils/palloc.h | 2 ++
6 files changed, 40 insertions(+), 36 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-02-27 16:20:47 pgsql: Remove PL/Tcl's "module" facility.
Previous Message Andres Freund 2017-02-27 12:01:18 pgsql: Use the new "Slab" context for some allocations in reorderbuffer