Search Postgresql Archives

How do I create a box from fields in a table?

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

 



I need to determine whether a given pair of coordinates is inside a given rectangle.  According to the documentation, PostgreSQL provides the box and point types and a "contains" operator that will be perfect for this.  However, the example provided in the documentation only shows the creation of boxes and points from constant values.  So, the following query works:

select tran_car_identification, box '((0, 1), (2, 3))' from transfer_car

But if I try to use a field from the transfer_car table, it doesn't work:

select tran_car_identification, box '((location, 1), (2, 3))' from transfer_car

That gives me an "invalid input syntax for type box" error.

How do I create a box object using data from the transfer_car table?

Thanks very much!

RobR


-- 
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