postgresql/contrib/dblink
Fujii Masao 5cb86a2622 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:37:08 +09:00
..
expected Revert use singular for -1 (commits 9ee7d533da and 5da9868ed9 2021-05-01 10:42:44 -04: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 Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile Remove support for upgrading extensions from "unpackaged" state. 2020-02-19 16:59:14 -05:00
dblink--1.0--1.1.sql Fix typo in update scripts for some contrib modules. 2013-07-19 04:13:01 +09:00
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:37:08 +09:00
dblink.control Update dblink extension for parallel query. 2016-06-17 15:18:44 -04:00
pg_service.conf Diagnose incompatible OpenLDAP versions during build and test. 2014-07-22 11:01:03 -04:00