ERROR 42P18 (indeterminate_datatype) could not determine data type of parameter $1 and dont really know why its happening, i tried on direct sql query and works well with the format and returns the polygon, so dont know why fails with on the formatPOLYGON(("latitude longitude,latitude longitude") and maybe quotes its making some conflict but dont really know, same query with same data but in direct sql its working coordinates its a value of type :geometrypolygon argument its a string but in format latitude longitude,latitude longitude,...