Create a "postgres" user account on OSX?

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

3

2 Answers

from the following stack overflow:

CREATE USER postgres SUPERUSER;
CREATE DATABASE postgres WITH OWNER postgres;
1

Create a new user with account name "postgres". Then you'll be able to do sudo su postgress.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like