Skip to content

Commit 2051fd3

Browse files
author
Etsuro Fujita
committed
postgres_fdw: Fix comments in connection.c.
Commit 27e1f14 missed updating some comments. Reviewed-by: Bharath Rupireddy Backpatch-through: 14 Discussion: https://postgr.es/m/CAPmGK15Q2Nm6U%2Ba_GwskrWFEVBZ9_3VKOvRrprGufpx91M_3Sw%40mail.gmail.com
1 parent ef2e107 commit 2051fd3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

contrib/postgres_fdw/connection.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ GetConnection(UserMapping *user, bool will_prep_stmt, PgFdwConnState **state)
195195
make_new_connection(entry, user);
196196

197197
/*
198-
* We check the health of the cached connection here when starting a new
199-
* remote transaction. If a broken connection is detected, we try to
200-
* reestablish a new connection later.
198+
* We check the health of the cached connection here when using it. In
199+
* cases where we're out of all transactions, if a broken connection is
200+
* detected, we try to reestablish a new connection later.
201201
*/
202202
PG_TRY();
203203
{
@@ -213,9 +213,7 @@ GetConnection(UserMapping *user, bool will_prep_stmt, PgFdwConnState **state)
213213
ErrorData *errdata = CopyErrorData();
214214

215215
/*
216-
* If connection failure is reported when starting a new remote
217-
* transaction (not subtransaction), new connection will be
218-
* reestablished later.
216+
* Determine whether to try to reestablish the connection.
219217
*
220218
* After a broken connection is detected in libpq, any error other
221219
* than connection failure (e.g., out-of-memory) can be thrown

0 commit comments

Comments
 (0)