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

[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