Kris Jurka <books@ejurka.com> writes:
> I'm not sure when the server applies
> our setting of client_encoding.
Immediately after switch scanning in PostgresMain, assuming you're
sending it the way I think. This is before the backend subprocess
attempts to verify the database or user name ... however, this is
after authentication (pg_hba.conf processing) so there's quite a
variety of failure messages that would be sent in the postmaster's
default encoding, whatever that might be. I'm afraid there's not
any really clean answer there.
regards, tom lane