Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running PostGIS 2.0 for PostGreSQL 9.2, and I have a customer who wants to know how close a provided geometry is to the nearest feature in a table. So I'm playing around with the "<->" and "<#>" operators. My problem? The "<#>" operator isn't recognized.

This works:

SELECT gid, 
    the_geom <-> ST_GeomFromEWKT('<my geometry>')
    FROM "<my table>"

This does not:

SELECT gid, 
    the_geom <#> ST_GeomFromEWKT('<my geometry>')
    FROM "<my table>"

I get an error:

ERROR:  operator does not exist: geometry <#> geometry

Am I missing something obvious?

share|improve this question
With psql, do you see it with \do <#>? And/or with pgAdmin, do you see it in the list of operators? – Mike T Apr 30 '13 at 0:01
It shows up, in psql, with "\do <#>" - left arb of abstime, right arg of abstime, result type of tinterval. Which doesn't seem to fit the description I see in the docs. "\do <->" shows a number of operators, taking box and box, circle and circle, circle and polygon, etc. – Jeff Dege Apr 30 '13 at 13:47
There is a problem with your installation, since the operator for geometry is not there. How did you install PostGIS to this database? Did you use the EXTENSION, etc.? – Mike T Apr 30 '13 at 19:02
also box, circle, polygon are not PostGIS types. – Mike T Apr 30 '13 at 19:03
I was mistaken, earlier. My local machine is Windows7, running PostGIS 2.0 for PostgreSQL 9.2 - and it's from that install from which come the clients I'm using (psql and PgAdmin). But the database I'm connecting to is running on an Ubuntu system, onto which the postgresql-8.4-postgis package has been installed. It seems to be running PostgreSQL 8.4.8. – Jeff Dege May 1 '13 at 14:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.