Greg Smith <greg(at)2ndQuadrant(dot)com> writes:
> Regardless, exactly how to prevent two concurrent processes from writing
> the same file feels like the last step in the small roadmap for what
> this feature needs.
"Write a temp file and use rename(2) to move it into place" is the
standard solution for that.
regards, tom lane