通过Node和Meteor连接Redshift PostgreSQL

我已经尝试过使用pg和其他模块和包来通过Node和Meteor连接Redshift PostgreSQL

这是我最近编写的节点代码。 无法连接到Redshiftclient.connect函数从不响应。

但是,如果我尝试连接到其他PostgreSQL服务器,如本地主机或其他远程服务器,然后代码正常工作。

meteor的问题也是一样的。

 var pg = require('pg'); var conString = "postgres://User:Password@EndPoint/Database"; //var conString = "postgres://postgres:postgres@localhost/postgres"; console.log("Started..."); var client = new pg.Client(conString); console.log("Client", client); client.connect(function(err) { if(err) { return console.error('could not connect to postgres', err); } client.query('SELECT NOW() AS "theTime"', function(err, result) { if(err) { return console.error('error running query', err); } console.log(result.rows[0].theTime); //output: Tue Jan 15 2013 19:12:47 GMT-600 (CST) client.end(); }); }); console.log("End..."); 

我想通过meteor连接。 但是,如果不能通过meteor, Node.js也将工作。