Password problems changing users in Terminal
To switch to user postgres, type in Terminal:

sudo su - postgres


If you are asked for a password, type yours.

(The - in sudo su - changes the environment to that of the new user, and it's probably what you want. See man su for details.)
Now, to switch back to your user, simply type:

exit


to exit the current bash session and go back to your original bash session.


Note that if you type sudo su &lt;user&gt; as user postgres you need to identify yourself to sudo and type postgres's password, but as you say, it hasn't any, so it won't work. It may even be the case that user postgres is not allowed to use sudo at all.