brianc/node-postgres — Issue #59: Problem doing Upsert in version 0.5.4
Author: jribeiro
Created: 2011-10-27 11:15:35+00:00
State: open

Hi there! Congrats on the excelent job!

I'm trying to do an upsert using node-postgres. The logic I was trying to implement was if an update returned error it should do the insert.

Both updates and inserts work but the code always executes both because the update statement returns the same values for success and error.

Have anyone tried this? Can anyone give a help please?

You can find full details (code + debug) here:
http://stackoverflow.com/questions/7910174/upsert-in-postgres-using-node-js

Thanks and congrats