The problem what Dhanaraj tries to address is how to secure solve
problem with PAM and local user. Other servers (e.g. sshd) allow to
run master under root (with limited privileges) and forked process
under normal user. But postgresql
requires start as non-root user. It limits to used common pattern.
There is important question:
Is current requirement to run postgresql under non-root OK? If yes,
than we must update PAM documentation to explain this situation which
will never works secure. Or if we say No, it is stupid limitation (in
case when UID 0 says nothing about user's privileges) then we must
start discussion about solution.