 <p>The <code>&lt;-&gt;</code> "distance between" operator applies to PostgreSQL geometric data types, not to the PostGIS <code>geography</code> data type. With the <code>geography</code> data type you can use the PostGIS function <code>ST_Distance()</code> and find the minimum value.</p> <pre><code>WITH this_cafe (latlng) AS ( SELECT latlng FROM cafes WHERE id = '3' ) SELECT cafes.*, ST_Distance(cafes.latlng, this_cafe.latlng, 'false') AS dist FROM cafes, this_cafe ORDER BY dist ASC LIMIT 1 </code></pre> <p>Note that the third argument <code>useSpheroid</code> to the function is set to <code>false</code> which will make the function much faster. It is unlikely going to affect the result because cafes tend to lie close to each other.</p> <p>This assumes that there is only 1 cafe with <code>id = 3</code>. If there could be more, then restrict the CTE to return just 1 row.</p>