postgres.app can't find database with my username

3.8k Views Asked by At

When I click Open psql on the Welcome to Postgres window with the fancy blue elephant, it opens a terminal and I get this command and output:

Tyler-Singer-Clarks-MacBook-Pro:~ Tyler$ '/Applications/Postgres.app/Contents/Version
/9.3/bin'/psql -p5432
psql: FATAL:  database "Tyler" does not exist

Why would this database exist or not exist? (I'm not really sure what is responsible for this database's existence, and thus where I should be looking in order to fix this issue)

EDIT: and the Welcome window says "You now have a PostgreSQL server running locally." And it did not give me an error about not being able to use port 5432.

2

There are 2 best solutions below

0
On BEST ANSWER

http://postgresapp.com/documentation/install.html

I uninstalled postgresql with brew uninstall postgresql and uninstalled Postgres.app by dragging the elephant from Applications to Trash and Emptying Trash. The key thing is to then follow the instructions in the above link and remove ~/Library/Application\ Support/Postgres. Only then did installing postgresql with brew install postgresql and Postgres.app with the installation instructions in that link finally work.

Classic, "Turn it off, turn it on" solution, but gotta do it fully and correctly.

0
On

Try executing createdb Tyler from the terminal.

PostgresApp is supposed to create a database with your user name during its setup. Apparently this sometimes fails and requires manual creation.

More info: PostgresApp Issue #139