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

Julien Chavanton notifications at github.com
Sat Mar 18 22:50:20 CET 2017


Why is insert_update doing nothing in Kamailio db insert_update ?

As explained in the following article the design of "UPSERT" in
PostgreSQL requires to be explicit about the constraint on which
we accept to do update modification to Kamailio database framework/API
would be required to expose which specific key constraint should be
handled as an update

http://pgeoghegan.blogspot.com/2015/10/avoid-naming-constraint-directly-when.html

In this first step, DO NOTHING is providing the simple feature to ignore
error on insert when facing a constraint violation
You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/1039

-- Commit Summary --

  * db_postgress: insert_update() with DO NOTHING

-- File Changes --

    M src/modules/db_postgres/db_postgres.c (1)
    M src/modules/db_postgres/db_postgres.h (2)
    M src/modules/db_postgres/km_dbase.c (83)
    M src/modules/db_postgres/km_dbase.h (5)
    M src/modules/db_postgres/km_pg_con.c (4)
    M src/modules/db_postgres/pg_mod.c (4)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/1039.patch
https://github.com/kamailio/kamailio/pull/1039.diff

-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170318/c093d7d3/attachment.html>


More information about the sr-dev mailing list