Module: kamailio
Branch: master
Commit: 2bebdb083ba8078fa9eec237fe0b0e2134a21b9b
URL:
https://github.com/kamailio/kamailio/commit/2bebdb083ba8078fa9eec237fe0b0e2…
Author: Julien Chavanton <jchavanton(a)gmail.com>
Committer: Julien Chavanton <jchavanton(a)gmail.com>
Date: 2019-06-25T08:49:45-07:00
db_postgres: fix, insert update should always
favor unique constraint over primary key
---
Modified: src/modules/db_postgres/km_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2bebdb083ba8078fa9eec237fe0b0e2…
Patch:
https://github.com/kamailio/kamailio/commit/2bebdb083ba8078fa9eec237fe0b0e2…
---
diff --git a/src/modules/db_postgres/km_dbase.c b/src/modules/db_postgres/km_dbase.c
index 4ddbe641b9..0ae7dff54d 100644
--- a/src/modules/db_postgres/km_dbase.c
+++ b/src/modules/db_postgres/km_dbase.c
@@ -788,7 +788,7 @@ static char *db_postgres_constraint_get(const db1_con_t *_h)
rows = RES_ROWS(res);
for(x = 0; x < RES_ROW_N(res); x++) {
val = (ROW_VALUES(&rows[x])[0]).val.string_val;
- type = (ROW_VALUES(&rows[x])[0]).val.string_val;
+ type = (ROW_VALUES(&rows[x])[1]).val.string_val;
LM_DBG("name[%s]type[%s]\n", val, type);
if(type[0] == 'u')
break; // always favor unique constraint over primary key constraint