in reply to regexp causes segfault

Try non-capturing parentheses.
/'(?:\\'|''|[^'])+'/
It should offer some improvement.

Update: Well, if it doesn't, it won't be much. I still get the same error messages as pg, on Windows. (Indigoperl 5.6.1, so it's not just a 5.8.0 thing.)