2

I am on Linux Mint Cinnamon 2.2.16.

During the process of getting Rails up and running, I am having problems with Postgres.

postgres@BL ~ $ psql --version
psql (Postgres-XC) 1.1
(based on PostgreSQL) 9.2.4

I was unable to get anything working under my usual username, so I changed to the default user using

sudo su - postgres

I cannot get anything to work with createuser.

postgres@BL ~ $ psql
psql: FATAL:  role "postgres" does not exist

postgres@BL ~ $ createuser -s -U $USER
createuser: could not connect to database postgres: FATAL:  role "postgres" does not exist

postgres@BL ~ $ sudo -u postgres createuser newname
Sorry, user postgres is not allowed to execute '/usr/bin/createuser newname' as postgres on BL.

postgres@BL ~ $ which psql
/usr/bin/psql
postgres@BL ~ $ psql \l
psql: FATAL:  role "postgres" does not exist
2
  • Try this solution: stackoverflow.com/questions/15301826/… Commented Jun 2, 2015 at 21:35
  • I get no output out of $ psql \l, instead gives me the same FATAL: role "postgres" does not exist. Makes me think I have no users at all, but require a user to create a user...? Commented Jun 2, 2015 at 22:47

2 Answers 2

1

After thoroughly researching the problem and tearing out more than a few hairs, I decided this was some variation of a problem with packaging/installation, similar problem noted here: unable to create user postgres: role "postgres" does not exists

I did a complete uninstall, as per below, and reinstalled without postgresql-xc

How to thoroughly purge and reinstall postgresql on ubuntu?

The new install had expected behavior with the user "postgres" and I was able to add myself as a superuser and create new databases. After some post-installation finagling, Rails seems to be running and playing nice with postgres.

Sign up to request clarification or add additional context in comments.

Comments

0

You have to authenticate to psql as the superuser in order to manage users. For example

psql -U root

Afterwards

create user paige with password 'paige';

3 Comments

Unfortunately, getting the same error here. postgres@BL ~ $ psql -U root psql: FATAL: role "root" does not exist
Do you remember the username you first used when installing postgres?
I don't believe I created a user with a unique name, though it did ask if I wanted to create a password for the "admin 'root' user", which I did. Is there any other standard user name beside admin, root, user, or postgres ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.