Vitalina
Vitalina

Reputation: 51

PG rails db:create InsufficientPrivilege: ERROR: permission denied to create db

I executed:

$ GRANT ALL PRIVILEGES ON db1 to user1
$ ALTER USER user1 CREATEDB
$ ALTER USER user1 CREATEDB
$ ALTER USER user1 WITH 'pass'

But still get an error on

$ rails db:create

config/database.yml:

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

development:
  <<: *default
  database: pg_app_development

Linux Manjaro. Rails 6.0.2.2 Ruby 2.7.1 Pg 12.2

Also I do not want to put superuser info in database.yml

Upvotes: 0

Views: 1027

Answers (1)

Vitalina
Vitalina

Reputation: 51

$ ALTER USER USER1 WITH CREATEDB

Upvotes: 1

Related Questions