3

I am trying to use Padrino with Sequel and Postgres and am having no luck connecting.

In my pg_hba.conf I set the postgres user to 'trust' so no password is required (and can log in using PgAdmin without a password).

# TYPE  DATABASE        USER            ADDRESS                 METHOD
  local all             postgres                                trust

My Padrino connection looks like this:

Sequel::Model.plugin(:schema)
Sequel::Model.raise_on_save_failure = false # Do not throw exceptions on failure
Sequel::Model.db = case Padrino.env
  when :development then Sequel.connect(:adapter=>'postgres', :host=>'localhost', :database=>'padrino_template_development', :user=>'postgres', :password=>'', :loggers => [logger])
  when :production  then Sequel.connect("postgres://localhost/padrino_template_production",  :loggers => [logger])
  when :test        then Sequel.connect("postgres://localhost/padrino_template_test",        :loggers => [logger])
end

When I then try and run the rake task sq:create

I get this message

rake sq:create
=> Creating database 'padrino_template_development'
Password: 
createdb: could not connect to database postgres: FATAL:  password authentication failed for user "postgres"
FATAL:  password authentication failed for user "postgres"
<= sq:create executed

What am I doing incorrectly here?

1 Answer 1

2

OK found the answer here, the problem is that the version of PgAdmin3 I was using had a bug in that made the user invalid as of 1970 when I changed the password.

The solution can be found here

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

Comments

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.