Hi I have an issue about the existing testcase.
""" -- Test that alteration of server options causes reconnection SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work ALTER SERVER loopback OPTIONS (SET dbname 'no such database'); SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should fail DO $d$ BEGIN EXECUTE $$ALTER SERVER loopback OPTIONS (SET dbname '$$||current_database()||$$')$$; END; $d$; SELECT c3, c4 FROM ft1 ORDER BY c3, c1 LIMIT 1; -- should work again """ IMO, the above case is designed to test the following code[1]: With the patch, it seems the following code[1] will not work for this case, right? (It seems the connection will be disconnect in pgfdw_xact_callback) I do not know does it matter, or should we add a testcase to cover that? [1] /* * If the connection needs to be remade due to invalidation, disconnect as * soon as we're out of all transactions. */ if (entry->conn != NULL && entry->invalidated && entry->xact_depth == 0) { elog(DEBUG3, "closing connection %p for option changes to take effect", entry->conn); disconnect_pg_server(entry); } Best regards, houzj