chomp PQerrorMessage() in backend uses
Peter Eisentraut <peter_e@gmx.net>
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.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/dblink/dblink.c | modified | +7 −7 |
| contrib/dblink/expected/dblink.out | modified | +0 −2 |
| contrib/postgres_fdw/connection.c | modified | +2 −12 |
| src/backend/replication/libpqwalreceiver/libpqwalreceiver.c | modified | +15 −15 |
| src/backend/utils/mmgr/mcxt.c | modified | +14 −0 |
| src/include/utils/palloc.h | modified | +2 −0 |