postgres_fdw: Useless if-test in GetConnection()
Etsuro Fujita <etsuro.fujita@gmail.com>
From: Etsuro Fujita <etsuro.fujita@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-03-15T10:18:41Z
Lists: pgsql-hackers
Attachments
- remove-useless-if-test.patch (application/octet-stream) patch
Hi, While working on something else, I noticed that the “if (entry->conn == NULL)” test after doing disconnect_pg_server() when re-establishing a given connection in GetConnection() is pointless, because the former function ensures that entry->conn is NULL. So I removed the if-test. Attached is a patch for that. I think we could instead add an assertion, but I did not, because we already have it in make_new_connection(). This would be harmless, so I am planning to apply the patch to HEAD only. Best regards, Etsuro Fujita
Commits
-
postgres_fdw: Remove useless if-test in GetConnection().
- 39a3bdc9eba5 16.0 landed