I have the following code where I'm trying to test a connection to postgres:
require 'pg' conn = PGconn.connect("localhost", 5432, '', '', "puppetdb", "puppetdb", "puppetbdb") res = conn.exec('select tablename, tableowner from pg_tables') I get back the error:
test.rb:3:in
initialize': FATAL: password authentication failed for user "puppetdb" (PG::ConnectionBad) from test.rb:3:innew' from test.rb:3:in `'
Yet I have a python script with the same credentials that seems to work perfectly:
import psycopg2 try: conn = psycopg2.connect("dbname='puppetdb' user='puppetdb' host='localhost' port='5432' password='puppetdb'") Given the python script I'm wondering if I've entered the credential wrong?
localhostand172.17.0.1are not the same