|
|
|
|
@ -155,7 +155,15 @@
|
|
|
|
|
|
|
|
|
|
--- a/modules/db_postgres/km_pg_con.c
|
|
|
|
|
+++ b/modules/db_postgres/km_pg_con.c
|
|
|
|
|
@@ -45,6 +45,9 @@
|
|
|
|
|
@@ -26,6 +26,7 @@
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "km_pg_con.h"
|
|
|
|
|
+#include "pg_mod.h"
|
|
|
|
|
#include "../../mem/mem.h"
|
|
|
|
|
#include "../../dprint.h"
|
|
|
|
|
#include "../../ut.h"
|
|
|
|
|
@@ -45,6 +46,9 @@
|
|
|
|
|
{
|
|
|
|
|
struct pg_con* ptr;
|
|
|
|
|
char *ports;
|
|
|
|
|
@ -165,16 +173,16 @@
|
|
|
|
|
|
|
|
|
|
LM_DBG("db_id = %p\n", id);
|
|
|
|
|
|
|
|
|
|
@@ -66,6 +69,8 @@
|
|
|
|
|
@@ -66,6 +70,8 @@
|
|
|
|
|
|
|
|
|
|
if (id->port) {
|
|
|
|
|
ports = int2str(id->port, 0);
|
|
|
|
|
+ keywords[i] = "port";
|
|
|
|
|
+ values[i++] = port_str;
|
|
|
|
|
+ values[i++] = ports;
|
|
|
|
|
LM_DBG("opening connection: postgres://xxxx:xxxx@%s:%d/%s\n", ZSW(id->host),
|
|
|
|
|
id->port, ZSW(id->database));
|
|
|
|
|
} else {
|
|
|
|
|
@@ -74,8 +79,24 @@
|
|
|
|
|
@@ -74,8 +80,24 @@
|
|
|
|
|
ZSW(id->database));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -196,7 +204,7 @@
|
|
|
|
|
+
|
|
|
|
|
+ keywords[i] = values[i] = NULL;
|
|
|
|
|
+
|
|
|
|
|
+ pcon->con = PQconnectdbParams(keywords, values, 1);
|
|
|
|
|
+ ptr->con = PQconnectdbParams(keywords, values, 1);
|
|
|
|
|
+ LM_DBG("PQconnectdbParams(%p)\n", ptr->con);
|
|
|
|
|
|
|
|
|
|
if( (ptr->con == 0) || (PQstatus(ptr->con) != CONNECTION_OK) )
|
|
|
|
|
|