问题描述:

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

Character: 1192

网友答案:

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;
相关阅读:
Top