Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> One thing that I am pondering is: how does SPI handle things if the
> client encoding and server encoding are not the same?
What? client_encoding is not used anywhere within the backend.
Everything should be server_encoding.
regards, tom lane