我有一些時間戳存儲爲Postgres類型timestamp without time zone。 我將使用時間戳2013-12-20 20:45:27作爲示例。我打算這代表UTC時間戳。 在psql中,如果我運行查詢SELECT start_time FROM table_name WHERE id = 1,我會返回該時間戳字符串,如預期的那樣:2013-12-20 20:45:27。 但是,如果
我已經它使用節點postgres的以下代碼: var client = new pg.Client(conString);
client.connect(function(err) {
if(err) {
throw new Error(console.error('could not connect to postgres '+ err));
}
我得到「錯誤:沒有參數$ 1」時,我嘗試使用node-postgres客戶端來運行這段代碼: app.post('/newcause', function (req,res){
console.log(req.body);
var g;
var r = [];
for (g in req.body)
{
r[g]=req.body[