[Devel] lcr module and postgres (wrong subject - was: lcr module and kannel)

Klaus Darilion klaus.mailinglists at pernau.at
Thu Jul 28 19:48:17 CEST 2005


Uuups - sorry for the wrong subject - of course I meant "postgres" and 
not "kannel"!

As you see, this really confuses me ;-)

regards,
klaus

Klaus Darilion wrote:
> Hi!
> 
> I've tried porting the lcr tables to postgres and encountered a problem:
> 
> The lcr module stores the values in unsigned integers in mysql. But, 
> there are no unsigend intergers in postgresql.
> 
> Thus, I have choosen the next bigger integer instead of the unsigned 
> one. Thus, I changed
> 
>   ip_addr INT UNSIGNED NOT NULL,
> 
> in mysql to
> 
>   ip_addr BIGINT CHECK (ip_addr > 0 AND ip_addr < 4294967296) NOT NULL,
> 
> in postgres. Thus storing in postgres is fine. But there is still a 
> problem when entering IP addresses where the last octet > 127.
> 
> Values in DB:
> openser=# select * from gw;
> gw_name| ip_addr  |port|uri_scheme|transport|grp_id
> -------+----------+----+----------+---------+-------
> test2  |2155839359|5060|         1|        2|     3 (127.127.127.128)
> test1  |2139062143|5060|         1|        2|     3 (127.127.127.127)
> 
> Values in lcr module:
> philipp:# openserctl fifo lcr_dump
> sip:127.127.127.127:5060:tcp
> sip:255.255.255.127:5060:tcp
> 
> Here is the debug output during "serctl fifo lcr_reload":
>  1(2520) PG[232] db_init entry
>  1(2520) PG[187] str2valp got int 2139062143
>  1(2520) PG[187] str2valp got int 5060
>  1(2520) PG[187] str2valp got int 1
>  1(2520) PG[187] str2valp got int 2
>  1(2520) PG[187] str2valp got int 2155839359
>  1(2520) PG[187] str2valp got int 5060
>  1(2520) PG[187] str2valp got int 1
>  1(2520) PG[187] str2valp got int 2
>  1(2520) PG[269] db_close entry
>  1(2520) **** done consume
> 
> 
> I do not have any glue where the problem occours: in lcr module? in 
> openser's DB API? in postgres module?
> 
> Any hints to track down and solve this problem are appreciated.
> 
> regards,
> klaus
> 
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
> 
> 




More information about the Devel mailing list