>> It ran without any error. But some of the resulted values in the_geom >> column became null or empty. How did you check this? select gid from thetable where the_geom is null? select gid from thetabel where npoints(the_geom) = P