[sr-dev] [kamailio/kamailio] db_postgress: insert_update() with DO NOTHING (#1039)

Julien Chavanton notifications at github.com
Mon Mar 20 20:10:10 CET 2017


The immediate value is the have a way to distinguish and ignore insert failures when they are caused by by a constraint violation.
The first use case would be in usrloc when we write to db and use dmq replication.
I would add a param to usrloc module "db_insert_update" defaulting to 0 but that could be set to 1, shit would already work completely with mysql

However with postgres, it would remove any unwanted errors and retries when syncing from dmq for example, I saw other posts about such errors.
This way usrloc would only retry it there is a real failure not a constraint violation.

Then we could plan for a second step to implement the "DO UPDATE" instead of just "DO NOTHING"

- add an optional param to insert_update (modify the db framework slightly) to specify the name of the constraint where we want to update on failure
- add a db_postgres module variables that could contain tablename_constraint and check for them when doing insert update 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1039#issuecomment-287866358
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170320/f4c796cb/attachment.html>


More information about the sr-dev mailing list