> I wonder why copyable_characters_length is not reset after flushing.
It's not necessary because of the break statement right after. But this part
of the code was refactored away in John's improved patch that's actually
merged:
https://github.com/postgres/postgres/commit/3838fa269c15706df2b85ce2d6af8aacd5611655