postgres_fdw: Useless if-test in GetConnection()

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: postgres_fdw: Useless if-test in GetConnection()
Date: 2023-03-15 10:18:41
Message-ID: CAPmGK169vQ83PQwQkoxO-AK2EeK1EsgsxixedM+BLWEAhZ_AqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
remove-useless-if-test.patch application/octet-stream 488 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-03-15 10:36:02 Re: TAP output format in pg_regress
Previous Message Melih Mutlu 2023-03-15 10:03:23 Re: Allow logical replication to copy tables in binary format