Well ,in fact, if I use the extension called odbc_fdw , the same problem will happen.
That’s because the odbc_fdw will also call the odbc driver. The follow pictures explain the situation.
Ah, right, I completely forgot this fdw. Yeah it may be worth renaming that in the odbc driver... Inoue-san, Saito-san, Heikki, thoughts about the simple patch attached? check_client_encoding is used to extract an encoding name from the connection settings. Perhaps we could do better than that.