I don't really see a compelling use-case for UPSERT. You can always do the equivalent of:
UPDATE table SET col1=xxx ... WHERE condition...;
if (rows_affected == 0) then INSERT INTO table (col1...) VALUES(...);
I guess the UPSERT statement would use only one DB round-trip so would be more efficient, but I don't see it as a huge deal.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds