Sergey KOPOSOV <Sergey(dot)Koposov(at)ed(dot)ac(dot)uk> writes:
> I also noticed when I tried to run pg_restore in the debugger the crash doesn't happen.
> but it does if I pipe it...
I wonder if your platform is helpfully inserting Windows newlines,
or perhaps removing them, when the data goes through a pipe.
regards, tom lane