Connecting to PostgreSQL Database

M

Matt White

Hello,

I am trying to move data from one postgres database to another using
the Ruby postgres adapter. However, I keep getting a password
authentication error whenever I try. My sysadmin keeps indicating that
there is no password on that database and the Rails apps I use don't
indicate any password in database.yml and work fine. Am I being lied
to or is there some other secret I don't know? Thanks for any help or
suggestions. Here's the code I'm using (and line 184 DOES work):

184: db1 = PGconn.connect('dbserver1.blah.com', 5432, '', '',
'database1_name', 'username', 'password')
185: db2 = PGconn.connect('dbserver2.blah.com', 5432, '', '',
'database2_name', 'username', '')

And here's the error:

c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/
connection.rb:55:in `initialize': FATAL C28000 MPassword
authentication failed for user "username" Fauth.c L395
Rauth_failed (RuntimeError)
from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/
postgres-pr/connection.rb:29:in `loop'
from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/
postgres-pr/connection.rb:29:in `initialize'
from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/
postgres-pr/postgres-compat.rb:23:in `new'
from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/
postgres-pr/postgres-compat.rb:23:in `initialize'
from DataFetcher.rb:185:in `connect'
from DataFetcher.rb:185
 
A

Anthony Eden

Hello,

I am trying to move data from one postgres database to another using
the Ruby postgres adapter. However, I keep getting a password
authentication error whenever I try. My sysadmin keeps indicating that
there is no password on that database and the Rails apps I use don't
indicate any password in database.yml and work fine. Am I being lied
to or is there some other secret I don't know? Thanks for any help or
suggestions. Here's the code I'm using (and line 184 DOES work):

184: db1 = PGconn.connect('dbserver1.blah.com', 5432, '', '',
'database1_name', 'username', 'password')
185: db2 = PGconn.connect('dbserver2.blah.com', 5432, '', '',
'database2_name', 'username', '')

And here's the error:

c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/
connection.rb:55:in `initialize': FATAL C28000 MPassword
authentication failed for user "username" Fauth.c L395
Rauth_failed (RuntimeError)
from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/
postgres-pr/connection.rb:29:in `loop'
from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/
postgres-pr/connection.rb:29:in `initialize'
from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/
postgres-pr/postgres-compat.rb:23:in `new'
from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/
postgres-pr/postgres-compat.rb:23:in `initialize'
from DataFetcher.rb:185:in `connect'
from DataFetcher.rb:185

Have you tried giving it a nil for the password rather than an empty string?

V/r
Anthony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top