Dani Oderbolz <oderbolz@ecologic.de> writes:
> why is this resetting the connection in this case?
Shortcoming of the COPY protocol: there's no good way to recover from an
error except to abandon the connection. (This is fixed in the protocol
redesign upcoming for 7.4, but there's just no way around it in the old
protocol.)
regards, tom lane