I have some function where I need to pass a point datatype .
somefunc("United States",Point(85.327892 27.703744))
But I am getting error with this.
ERROR: syntax error at or near "27.703744"
SQL state: 42601
Maybe try add a comma between the function params?
somefunc("United States",Point(85.327892, 27.703744))
I sense some confusion between PostGIS and PostgreSQL's geometric data types. If you are using PostGIS, you need the
ST_MakePoint function, which is perfect for parameters:
SELECT ST_SetSRID(ST_MakePoint($lon, $lat), 4326)) AS geom;