Thue Janus Kristensen <thuejk(at)gmail(dot)com> writes:
> I finally succeeded in creating a test case, after much experimentation.
> Running the attached sql crashes my postgresql server 100% of the time.
Cute problem. The attached fix cures it for me; would you see if it
solves your original case too?
regards, tom lane