debugging PostgreSQL serialization failures
It'd be good to have, but I don't think there's really much there at the moment. It's particularly tricky because multiple statements are often involved and the culprit(s) aren't always the current running ones, especially on at-commit failures. Collecting the extra info would be ruinous for performance and memory use, but it'd be a great option to be able to turn on when debugging.

Your best bet is probably to greatly increase your log levels and make sure you have a log_line_prefix including %m, %p, %c:%l and %v:%x so you have the transaction and session information required to identify and reassemble what sessions and their xacts did from the logs.