Hello Daniel
Think i found way how to properly escape blob strings.
need to execute `SET bytea_output=escape;` command when connection created
This maybe done in function 
[`db_postgres_new_connection`](https://github.com/kamailio/kamailio/blob/master/src/modules/db_postgres/km_pg_con.c#L48-L152).

By default psql output BLOBs in hex format. After `SET bytea_output=escape;` 
this behaviour is changed to expected by Kamailio.
```
pg1b:~$ psql kamailio
psql (9.6.3)
Type "help" for help.

kamailio=# CREATE TABLE blob_table (blob bytea);
CREATE TABLE
kamailio=# INSERT INTO blob_table VALUES ('Kamailio');
INSERT 0 1
kamailio=# SELECT * FROM blob_table;
        blob        
--------------------
 \x4b616d61696c696f
(1 row)

kamailio=# SET bytea_output=escape;
SET
kamailio=# SELECT * FROM blob_table;
   blob   
----------
 Kamailio
(1 row)

kamailio=# 
```
Could you suggest patch and then i will test on my servers.

-- 
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/issues/1255#issuecomment-427683551
_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to