[OpenSIPS-Devel] db_postgres text type should be mapped to DB_STRING

Kiss Karoly kiss.karoly at ephone.hu
Thu Aug 11 09:28:02 CEST 2011


While debugging a database issue, I ran into the postgresql type to opensips internal type mapping code.
In the file modules/db_postgres/res.c around line 153 the postgresql type text is mapped to a blob,
which in my opinion is incorrect, since it is listed in the postgresql documentation [1] along with
char and varchar. One could argue, that unlike text, varchar is a limited length column, and this is 
why a text column should be considered blob instead of string. This is also incorrect, since in postgres
one can create a column of type varchar without a limit. Well actually the limit is around 1G but that's
not the point.
My point is, that in the postgresql module TEXTOID should map to DB_STRING in opensips instead of DB_BLOB. 

What do you think ?

[1] http://www.postgresql.org/docs/8.4/interactive/datatype-character.html

Regards,
Kiss Karoly



More information about the Devel mailing list