I am trying to create a new user. I am getting same error consistently. I tried lot of solutions given online but no luck.
I am using
Postgres 9.5
Ubuntu 16.04
my username ravi
I am trying by this command
createuser -e -E sonar -s -U "$(whoami)" -P
I am getting an error like this:
Enter password for new role:
Enter it again: Password:
createuser: could not connect to database postgres: FATAL: password authentication failed for user "ravi"
sudo -u postgres -i, thencreateuserand arguments. wiki.archlinux.org/index.php/PostgreSQLcreateuser -U postgres ...should work as well (if the postgres role is allowed to login with a password)