postgresql/contrib/dblink
Fujii Masao 557c39bba9 postgres_fdw: Fix unexpected reporting of empty message.
pgfdw_report_error() in postgres_fdw gets a message from PGresult or
PGconn to report an error received from a remote server. Previously
if it could get a message from neither of them, it reported empty
message unexpectedly. The cause of this issue was that pgfdw_report_error()
didn't handle properly the case where no message could be obtained
and its local variable message_primary was set to '\0'.

This commit improves pgfdw_report_error() so that it reports the message
"could not obtain ..." when it gets no message and message_primary
is set to '\0'. This is the same behavior as when message_primary is NULL.

dblink_res_error() in dblink has the same issue, so this commit also
improves it in the same way.

Back-patch to all supported branches.

Author: Fujii Masao
Reviewed-by: Bharath Rupireddy
Discussion: https://postgr.es/m/477c16c8-7ea4-20fc-38d5-ed3a77ed616c@oss.nttdata.com
2021-12-03 17:35:29 +09:00
..
expected Improve HINT message that FDW reports when there are no valid options. 2021-10-27 00:46:52 +09:00
input Use setenv() in preference to putenv(). 2020-12-30 12:56:06 -05:00
output Use setenv() in preference to putenv(). 2020-12-30 12:56:06 -05:00
sql Improve HINT message that FDW reports when there are no valid options. 2021-10-27 00:46:52 +09:00
.gitignore
dblink--1.0--1.1.sql
dblink--1.1--1.2.sql Fix parallel-safety markings for contrib/dblink. 2016-06-17 23:08:21 -04:00
dblink--1.2.sql Fix parallel-safety markings for contrib/dblink. 2016-06-17 23:08:21 -04:00
dblink.c postgres_fdw: Fix unexpected reporting of empty message. 2021-12-03 17:35:29 +09:00
dblink.control Update dblink extension for parallel query. 2016-06-17 15:18:44 -04:00
Makefile Remove support for upgrading extensions from "unpackaged" state. 2020-02-19 16:59:14 -05:00
pg_service.conf