create a box from point? - Mailing list pgsql-novice

From Frank Bax
Subject create a box from point?
Date
Msg-id BLU0-SMTP4629C36D164F1069785F15AC820@phx.gbl
Whole thread Raw
Responses Re: create a box from point?  (Krzysztof Hoffmann <krzysiekpl@gmail.com>)
List pgsql-novice
PGSQL 8.4.1  How can I create a box from point?

create table geo (id int, p point);
insert into geo values(1,'(143.032,-81.2315)');

SELECT ((p[0]-.5,p[1]-.5),(p[0]+.5,p[1]+.5)) AS boxx from geo;
                    boxx
-------------------------------------------
  ("(142.532,-81.7315)","(143.532,-80.7315)")

SELECT ((p[0]-.5,p[1]-.5),(p[0]+.5,p[1]+.5))::box AS boxx from geo;
ERROR:  cannot cast type record to box



pgsql-novice by date:

Previous
From: Chip Steele
Date:
Subject: Streaming Replication in PostgreSQL9.0 b4: Standby dropping connections
Next
From: Florian Henge
Date:
Subject: xml output