ST_Equals(A, B) returns true if every point in the set of points that make up A is also in B, and if every point in the set of points that make up B is also in A. The ordering of the points in A and B may differ, but they must be made up of equivalent sets.
Another way of describing ST_Equals(A, B) is that it will return true if both ST_Within(A, B) and ST_Within(B, A) also return true.
ST_Equals works on the following data types:
ST_Equals will attempt to use any available to speed up its operation.
Use the prefixed variant _ST_Equals if you do not want any spatial indexes to be used.Examples
The screenshots in these examples were generated using geojson.io, but they are designed to
showcase the shapes, not the map. Representing
GEOMETRY data in GeoJSON can lead to unexpected results if using
geometries with other than 4326 (as shown below).True
In this example,ST_Equals returns true because:
- Every Point in the set of Points that make up Polygon A is also in Polygon B, and every Point in the set of Points that make up Polygon B is also in Polygon A

False
In this example,ST_Equals returns false because:
- It’s obvious that not every Point that makes up the set of Points in Polygon A is not also in Polygon B.


