I have a table called as events. events has a column of point datatype. (x,y) = (latitude,longitude) for the point. Now, I have an another set of points whose latitude and longitude are known. Now, I want to form a polygon of these points and then want to know how many event points are present in this polygon. I am not able to formulate the query.
I tried using
ST_AsText(ST_PointOnSurface('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'::geometry));
But couldn't find the answer.