postgresql/contrib/postgres_fdw
Fujii Masao 44ccdce514 postgres_fdw: Fix bug in checking of return value of PQsendQuery().
When postgres_fdw begins an asynchronous data fetch, it submits FETCH query
by using PQsendQuery(). If PQsendQuery() fails and returns 0, postgres_fdw
should report an error. But, previously, postgres_fdw reported an error
only when the return value is less than 0, though PQsendQuery() never return
the values other than 0 and 1. Therefore postgres_fdw could not handle
the failure to send FETCH query in an asynchronous data fetch.

This commit fixes postgres_fdw so that it reports an error
when PQsendQuery() returns 0.

Back-patch to v14 where asynchronous execution was supported in postgres_fdw.

Author: Fujii Masao
Reviewed-by: Japin Li, Tom Lane
Discussion: https://postgr.es/m/b187a7cf-d4e3-5a32-4d01-8383677797f3@oss.nttdata.com
2022-07-22 11:59:38 +09:00
..
expected Tweak detail and hint messages to be consistent with project policy 2022-07-20 09:50:12 +09:00
sql postgres_fdw: be more wary about shippability of reg* constants. 2022-07-17 18:11:22 -04:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
Makefile postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
connection.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
deparse.c postgres_fdw: be more wary about shippability of reg* constants. 2022-07-17 18:11:22 -04:00
option.c Tweak detail and hint messages to be consistent with project policy 2022-07-20 09:50:12 +09:00
postgres_fdw--1.0--1.1.sql postgres_fdw: Add functions to discard cached connections. 2021-01-26 15:35:54 +09:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c postgres_fdw: Fix bug in checking of return value of PQsendQuery(). 2022-07-22 11:59:38 +09:00
postgres_fdw.control postgres_fdw: Add function to list cached connections to foreign servers. 2021-01-18 15:11:08 +09:00
postgres_fdw.h Fix postgres_fdw to check shippability of sort clauses properly. 2022-03-31 14:29:48 -04:00
shippable.c Update copyright for 2022 2022-01-07 19:04:57 -05:00