[Kamailio-Devel] postgres queries overlapping

H Quintana hjqlopez at yahoo.com
Tue Jul 29 22:12:40 CEST 2008


Hi dear developers,


I just upgraded from 1.2.2 to 1.3.2 and I'm getting a postgres error because the DELETE query (delete from location where expires...) is overlapped with a previous INSERT in the accounting table. 

I did some changes in postgres/dbase.c to always set the end of the string for pg_delete, pg_update, pg_query, as it is for pg_insert.  I dont know if that is the best solution but it's working for me.

Please let me know if that was ok or there is a better way to fix it.


Thanks for your time,

Humberto


*******The problem's log*******


Jul 29 13:06:01 localhost /usr/local/sbin/openser[4730]: WARNING:postgres:pg_get_result: 0x8193ef0 Probable invalid query

Jul 29 13:06:01 localhost /usr/local/sbin/openser[4730]: WARNING:postgres:pg_get_result: 0x8193ef0: PGRES_FATAL_ERROR

Jul 29 13:06:01 localhost /usr/local/sbin/openser[4730]: WARNING:postgres:pg_get_result: 0x8193ef0: ERROR:  syntax error at or near "_from" LINE 1: ...07-29 13:06:02' AND expires!='1969-12-31 19:00:00'_from,sip_...                                                              ^

Jul 29 13:06:01 localhost /usr/local/sbin/openser[4730]: WARNING:postgres:pg_delete: 0x8193ef0 Query: delete from location where expires<'2008-07-29 13:06:02' AND expires!='1969-12-31 19:00:00'_from,sip_to,i_uri,o_uri,from_uri,to_uri,username,domain,hunt,invite_time,ringing_time ) values ('INVITE','e5326044ad106ef2', ...


**********My solution(?) ********

[root at localhost postgres]# diff dbase.c dbase.c.orig
656d655
<       *(_s + off) = '\0';
852d850
<       *(_s + off) = '\0';
895a894
>               *(_s + off) = '\0';
897d895
<       *(_s + off) = '\0';






      



More information about the Devel mailing list