Randall Wilson <rwilson@xxxxxxxxxxxxxxx> writes: > log_line_prefix = '[%t] %i' > So, "idle" is just the "command tag", which probably means it's not > associated with a command. No, you missed my point: if an incoming command contains invalidly encoded characters, the error about that will be thrown *before* the command tag can be changed from "idle". I think you are looking in the wrong place entirely --- the bad data is not in the database, it's coming from a client. regards, tom lane