In my node application i am connecting to a postgres sql in remote system
I have the following connection code:
var sequelize = new Sequelize('postgres://username:[email protected]:5432/dbname');
Its working fine.. but the following connection is not working:
// initialize database connection
var sequelize = new Sequelize(
config.dbname,
config.username,
config.password, {
dialect: 'postgres',
port:'5432'------------------->specified port here..
});
My config file:
{
"server": {
"port": 3000,
"forks": 1,
"siteUrl": "http://xxx.xxx.xx.xxx:3000"
},
"dbpostgres": {
"host": "xxx.xx.xx.xx",
"username": "username",
"port" : 5432,
"password": "password",
"dbname": "dbname"
}
I am receiving the following error:
"Error: connect ECONNREFUSED"," at errnoException (net.js:770:11)","
Please help me to solve this..Thanks in advance.....
}
var sequelize =new Sequelize(..., {port: config.port, dialect: 'postgres'}
. Doesn't this work? – bnuhero Mar 19 '14 at 5:21port: 5432
– bnuhero Mar 19 '14 at 5:32protocol: null
to the configuration. FYI: options – bnuhero Mar 19 '14 at 5:50