Hi, Thanks for all the responses. I will check this options: 1) http://trac.osgeo.org/postgis/ticket/413 2) http://trac.osgeo.org/postgis/wiki/UsersWikiplpgsqlfunctions 3) Something similar to the above options Sascha