[SQL] Need a little help with geometric query

2011-08-25 Thread lxnf98mm

This is my first shot at using postgresql's geometric functions
I have a passel of lines defined by x1 y1 x2 y2
I created a table with type lseg and loaded it
I start by finding the line that has an end closest to 0,0
Now I want to find the next line that has an end closest to the first line's 
other end and so on
I want to find the shortest path
I see there are a lot of geometric operators but I am a bit baffled
Can someone offer suggestions or reading references

Thanks
Richard

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


[SQL] ERROR: cannot subscript type text because it is not an array

2011-08-31 Thread lxnf98mm

I have table with field l type lseg

 Column |  Type   | Modifiers
+-+---
 cnt| integer |
 used   | boolean |
 l  | lseg|
 c  | text|

select l from t where used = false group by l[0];
ERROR:  cannot subscript type text because it is not an array

select l from gcode where used = false group by l[0][0],l[0][1];
ERROR:  cannot subscript type text because it is not an array


Using PostgreSQL 8.3.11
How can I work around this

Richard

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