I have a situation where I don't know how much shared memory I need, so I made the shared memory grow when it ran out of space. My shared memory is shared between a process running as root and postgres, which won't run as root. So I set the permissions to unrestricted (0666) when I create the shared memory. My problem is that when I grow the shared memory, the permissions are reset to (0644). This breaks things, as postgres can no longer open the shared memory for writing. I followed the code a bit and saw that it was using ftruncate. Checking the man page for ftruncate reveals, "the set-user-ID and set-group-ID permission bits may be cleared." Has anyone else ran into this? What is the easy solution? Should I just set the permissions manually after growing? Is this a bug in the interprocess library? --- Aaron Wright