postgres.git / summary / log / commit / refs
commit 972c7c6567fbb02a59b94ede80b17805de1bc03c
Author: Etsuro Fujita <efujita@postgresql.org>
Date: Thu Oct 07 09:15:00 2021 +0000
First released in: 15.0, 14.1
postgres_fdw: Fix comments in connection.c.
Commit 27e1f1456 missed updating some comments.
Reviewed-by: Bharath Rupireddy
Backpatch-through: 14
Discussion: https://postgr.es/m/CAPmGK15Q2Nm6U%2Ba_GwskrWFEVBZ9_3VKOvRrprGufpx91M_3Sw%40mail.gmail.com
contrib/postgres_fdw/connection.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c
index 1e67da983cb..ce0164e9d23 100644
--- a/contrib/postgres_fdw/connection.c
+++ b/contrib/postgres_fdw/connection.c
@@ -197,9 +197,9 @@ GetConnection(UserMapping *user, bool will_prep_stmt, PgFdwConnState **state)
make_new_connection(entry, user);
/*
- * We check the health of the cached connection here when starting a new
- * remote transaction. If a broken connection is detected, we try to
- * reestablish a new connection later.
+ * We check the health of the cached connection here when using it. In
+ * cases where we're out of all transactions, if a broken connection is
+ * detected, we try to reestablish a new connection later.
*/
PG_TRY();
{
@@ -215,9 +215,7 @@ GetConnection(UserMapping *user, bool will_prep_stmt, PgFdwConnState **state)
ErrorData *errdata = CopyErrorData();
/*
- * If connection failure is reported when starting a new remote
- * transaction (not subtransaction), new connection will be
- * reestablished later.
+ * Determine whether to try to reestablish the connection.
*
* After a broken connection is detected in libpq, any error other
* than connection failure (e.g., out-of-memory) can be thrown
[parent: 700c73312841]