Hi Tom: Am 22.03.18 23:55 schrieb(en) Tom Lane:
It finally occurred to me what is a likely explanation for why you're seeing these messages but I don't when I test postgres_fdw locally: probably, you are encrypting connections to the foreign server with SSL.
I can confirm that the confusing LOG messages go away when I disable SSL in the server definition, i.e. either by explicitly stating CREATE SERVER ext_server FOREIGN DATA WRAPPER postgres_fdw OPTIONS ( dbname 'ext_db', host 'localhost', sslmode 'disable', updatable 'false'); or by just saying CREATE SERVER ext_server FOREIGN DATA WRAPPER postgres_fdw OPTIONS ( dbname 'ext_db', updatable 'false'); Linking different data bases on the same machine using the FDW may be a special use case, though…
Anyway, it's clearly not very nice that postgres_fdw makes no attempt to do a graceful shutdown of its remote connection. I don't know that this rises to the level of a bug, exactly, but if somebody wanted to send in a patch it'd probably get accepted.
Knowing the background and the workarounds above, I agree with you that it's basically noise. It would be nice if there was a note about it in the documentation, though – other users might stumble over it, too. A different, confusing point (which is closer to a “bug” IMHO) is that connections to localhost are actually encrypted by default. This is basically useless and just a waste of cpu cycles – if a malicious user may somehow tap (tcpdump) lo, there is a different problem which can not be mitigated by encryption… Thank you so much for your help and insights! Cheers, Albrecht.
Attachment:
pgp1EtTENvWa5.pgp
Description: PGP signature