I'm creating a Rails app and using a Postgresql database with it. I've created a few tables and a user, core
, which is the owner of each of the tables.
postgres=# create user core with password 'n7zD5FG5';
CREATE ROLE
postgres=# create database core_apps_prod with owner core;
CREATE DATABASE
postgres=# create database core_apps_dev with owner core;
CREATE DATABASE
postgres=# create database core_apps_test with owner core;
CREATE DATABASE
And my database.yml
file:
development:
adapter: postgresql
database: core_apps_dev
username: core
password: n7zD5FG5
host: localhost
However, when I run rake db:migrate
, I get the error
rake aborted!
FATAL: password authentication failed for user "core"
I also cannot connect to psql
manually: psql -U core -W -d core_apps_dev
- I get the same error.
How can I allow core
to connect to Postgresql on localhost
?
The output of SELECT * FROM pg_roles where rolname='core';
is:
rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcatupdate | rolcanlogin | rolreplication | rolconnlimit | rolpassword | rolvaliduntil | rolconfig | oid
---------+----------+------------+---------------+-------------+--------------+-------------+----------------+--------------+-------------+---------------+-----------+-------
core | f | t | f | f | f | t | f | -1 | ******** | | | 16392