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

Kiss Karoly kiss.karoly at ephone.hu
Mon Aug 22 18:29:18 CEST 2011


Hello Bogdan,

On 2011/08/22 13:53, Bogdan-Andrei Iancu wrote:
> Hi Kiss,
> 
> I find your logic flawless, at least from my understanding over postgres.
Thanks. :o)

> You mentioned a patch for this...... ;)
Yes, it's a little change, but I wish to understand the implications first, and also do some tests
after changing the code. I will do it I just need some more time ...

> BTW, in what cases do you use the TEXTOID ?
I have a pretty badly hacked database, mostly because I needed to bridge in some parameters using
functions and recursive queries. I can use typecasts to cast all text types to varchar and it works
after that, but it's very annoying to keep typecasting things when in fact the two types of columns
are virtually the same type.

Regards,
Kiss Karoly

> 
> Regards,
> Bogdan
> 
> On 08/11/2011 10:28 AM, Kiss Karoly wrote:
> >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
> >
> >_______________________________________________
> >Devel mailing list
> >Devel at lists.opensips.org
> >http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
> >
> 
> 
> -- 
> Bogdan-Andrei Iancu
> OpenSIPS eBootcamp - 19th of September 2011
> OpenSIPS solutions and "know-how"
> 
> 
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel



More information about the Devel mailing list