postgresql/contrib/postgres_fdw
Fujii Masao 7fc1a81e49 postgres_fdw: Restructure connection retry logic.
Commit 32a9c0bdf introduced connection retry logic into postgres_fdw.
Previously it used goto statement for retry. This commit gets rid of that
goto from the logic to make the code simpler and easier-to-read.

When getting out of PG_CATCH() for the retry, the error state should be
cleaned up and the memory context should be reset. But commit 32a9c0bdf
forgot to do that. This commit also fixes this bug.

Previously only PQstatus()==CONNECTION_BAD was verified to detect
connection failure. But this could cause false detection in the case where
any error other than connection failure (e.g., out-of-memory) was thrown
after a broken connection was detected in libpq and CONNECTION_BAD is set.
To fix this issue, this commit changes the logic so that it also checks
the error's sqlstate is ERRCODE_CONNECTION_FAILURE.

Author: Fujii Masao
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/2943611.1602375376@sss.pgh.pa.us
2020-10-16 13:58:45 +09:00
..
expected Band-aid new postgres_fdw test case to remove error text dependency. 2020-10-10 19:57:25 -04:00
sql Band-aid new postgres_fdw test case to remove error text dependency. 2020-10-10 19:57:25 -04:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
connection.c postgres_fdw: Restructure connection retry logic. 2020-10-16 13:58:45 +09:00
deparse.c Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
option.c Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c Fixup some appendStringInfo and appendPQExpBuffer calls 2020-10-15 20:35:17 +13:00
postgres_fdw.control Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
shippable.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00