Search code examples
postgresqlpostgispostgresql-12

postgres st_dwithin doesn't exist


Here is my OS & db version

cat /etc/centos-release

CentOS Linux release 7.6.1810 (Core)



################################################

psql --version

PostgreSQL 12.1

I already installed postgres and postgis.

enter image description here

but still, I cannot use ST_Dwithin or ST_Distance ... and so on. I can use stddev... ? (this is useless method to me currently)

enter image description here this means -> "No function matches the specified name and argument data types. You may need to add explicit casters"

What more should I check? Please let me know.


Solution

  • You're calling ST_DWithin using numeric parameters instead of geometries, and therefore the error message:

    .. Function st_dwithin(numeric, numeric, integer) does not exist ..

    This function expects 1) geometry 2) geometry and 3) double precision.

    SELECT 
      ST_DWithin(
      'POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))'::GEOMETRY,
      'POINT (29 10)'::GEOMETRY,
      3000);