>> so it seems to make sure the real/saved uid matches the effective uid.
>> Now, considering we don't use uid/euid distinction for anything, I agree
>> it is useless and should be removed.
> No, it is NOT useless and must NOT be removed.
But it would make sense to move it over to main.c where the primary
test for not running as root is, since these are closely related
considerations: we don't want either euid or ruid to be root.
I'll make that change unless I hear objections...
regards, tom lane