Search Postgresql Archives

Re: "IN" in a geometric database using data type "point"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Romain Billoir <billoirr@xxxxxxxxx> writes:
> Hi, i'm trying to request a database using data type "point" using keyword
> "IN" with a list of point generated by PHP, like this:
> 'SELECT * FROM map WHERE position IN ((point(-1,-1), (point(1,-1),
> point(1,1), point(-1,1))'
> but this request returns me an error: operator doesn't exist point = point.

For historical reasons the equality operator for points is named ~=
... which IN doesn't understand.  I think your best bet is to spell
it out instead of using the IN shorthand:

SELECT * FROM map WHERE position ~= point(-1,-1) or position ~= point(1,-1)
or position ~= point(1,1) ...

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux