On Tue, Oct 28, 2008 at 07:13:38AM -0700,
Tim Bruce - Postgres <postgres(at)tbruce(dot)com> wrote
a message of 41 lines which said:
> Wouldn't it be better to add the line 'sudo su - postgres' as the
> entry (command) for the user(s) in the sudoers file?
Simpler, set the "runas" parameter:
jsmith ALL=(postgres) ALL
That way, user "jsmith" can run anything as the "postgres" user, such as:
% sudo -u postgres createdb foobar
(I simply do not understand why to use the old su together with
sudo. su is almost useless today: it does not allow fine-grain
control, it doesn't log, etc.)