I am trying to connect to pg like such
require 'pg'
db1_params = {
host: 'DBHOST',
dbname: 'DBNAME',
user: 'DBUSER',
password: 'DBPASSWORD',
port: 5432
}
db1 = PG::Connection.new(db1_params)
orders = db1.exec_params('SELECT count(*) from orders')
puts orders
But i am getting `initialize': could not connect to server: Operation timed out (PG::ConnectionBad) error. My main goal is to initialize db1 and db2 and count orders rows on both and match the total. Is there any better way of achieving this? Its not just one table, there are 150 tables and i need to count rows on all tables on both db and match the results.