1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

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.
This commit is contained in:
Peter Eisentraut
2017-02-27 08:30:06 -05:00
parent 9fab40ad32
commit 2ed193c904
6 changed files with 40 additions and 36 deletions

View File

@ -377,7 +377,6 @@ FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[])
WHERE t.a > 7;
ERROR: could not establish connection
DETAIL: missing "=" after "myconn" in connection info string
-- create a named persistent connection
SELECT dblink_connect('myconn',connection_parameters());
dblink_connect
@ -604,7 +603,6 @@ FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[])
WHERE t.a > 7;
ERROR: could not establish connection
DETAIL: missing "=" after "myconn" in connection info string
-- create a named persistent connection
SELECT dblink_connect('myconn',connection_parameters());
dblink_connect