So, I installed postgresql9.3 on Ubuntu. Now I have to create a new user. Thus, anything is possible with the help of postgres superuser. But I need every new db to be a new user.
So what I did:
sudo -u postgres psql CREATE USER python with PASSWORD 'python'; CREATE DATABASE dbpython; GRANT ALL PRIVILEGES ON DATABASE dbpython to python;
I also changed the / etc / postgresql / 9.1 / main / pg_hba.conf file and changed the local frompeer authentication option to md5.
After restarting postgres, I want to use a new user:
ubuntu@ip-172-31-33-139 :~$ su python No passwd entry for user 'python'
But
ubuntu@ip-172-31-33-139 :~$ sudo service postgresql restart * Restarting PostgreSQL 9.3 database server [ OK ] ubuntu@ip-172-31-33-139 :~$ psql -d dbpython -U python Password for user python: psql (9.3.6) Type "help" for help. dbpython=>
Why does this work, but su python is not? Important note: I am not creating a new python user in my Ubuntu, I hope this is not necessary for every new user in postgres.
sql postgresql ubuntu
lvthillo
source share