Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just made a mistake: I installed PostgreSQL on Mac OSX 10.6.7 and when I wanted to connect to it I did su postgres, then it asked me for a password and I did sudo passwd postgres to change the password to something I know.

The problem is, as explained here, this created a Unix user account for postgres and afterwards I had two users on my Mac : me and postgres.

So I deleted the postgres account. Now I cannot connect to postgres because I just cannot su postgres. How to recreate a "locked" user account postgres that I could use safely (by doing sudo su postgres as I should have done before) ?

Edit: added version of Mac OS X

share|improve this question
Uninstall and reinstall PostgreSQL? That's probably the safest route, given that you'd need to assign the correct user ID etc. Other than that, this question contains command line calls on how to create user accounts manually, and the answer explains how to not assign a password. It worked on my machine when I tested it, so chances are it'll work on yours. – Daniel Beck Jan 12 '12 at 9:26
It'd be helpful if you'd mention the major release of OS X you're using. Just, you know, things change over 10+ years. – Daniel Beck Jan 12 '12 at 9:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.