10

I feel like I should know this, but I don't! šŸ˜ž

When creating a new rails app with --database=postgresql the database.yml looks like:

...
default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see Rails configuration guide
  # http://guides.rubyonrails.org/configuring.html#database-pooling
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
  <<: *default
  database: big_bustas_development
...

Now I can do all manner of rails db:create ...migrate...ect without explitly configuring a database user and password. What postgres credentials is rails using the accomplish this?

1 Answer 1

10

PostgreSQL by default use your OS username. The default authentication mode for PostgreSQL is set to ident. Read this article and/or docs for more information.

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

1 Comment

Awesome. Thank you!

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.