You are trying to mix PostgreSQL's built-in (limited, but useful) geometric types with PostGIS functions. It sounds like you didn't install PostGIS, either. You've also typo'd the function name, it's ST_Intersects
not ST_Intersect
.
First, if you want to use PostGIS, make sure it's installed and then:
CREATE EXTENSION postgis;
Next, you'll probably find that you can't actually call ST_Intersects
with a point
and a polygon
. PostGIS works with its own geometry
type. It has some converters for the PostgreSQL internal types, but they're only limited. So calling PostGIS functions with primitive geometric types can result in errors like:
postgres=# SELECT ST_Intersects( polygon( box(point(0,0), point(10,10)) ), point(5,5) );
ERROR: function st_intersects(polygon, point) does not exist
LINE 1: SELECT ST_Intersects( polygon( box(point(0,0), point(10,10))...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
You'll often have to convert them to PostGIS's own geometry
type. PostGIS provides some explicit casts for this for most types, e.g.:
postgres=# SELECT ST_Intersects(
polygon( box(point(0,0), point(10,10)) )::geometry,
point(5,5)::geometry
);
st_intersects
---------------
t
(1 row)
So in your query, that'd be:
ST_Intersects(A.point_LatLong::geometry , B.polygon_abc::geometry);