Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 437BF475E34 for ; Thu, 8 Aug 2002 09:37:06 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 8457B475E51 for ; Thu, 8 Aug 2002 09:35:55 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g78DZmVk002703; Thu, 8 Aug 2002 09:35:48 -0400 (EDT) To: floyds@4peakstech.com Cc: pgsql-sql@postgresql.org Subject: Re: manipulating the POINT data type In-reply-to: References: Comments: In-reply-to "Floyd Shackelford" message dated "Wed, 07 Aug 2002 11:16:26 -0600" Date: Thu, 08 Aug 2002 09:35:48 -0400 Message-ID: <2702.1028813748@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/152 X-Sequence-Number: 8998 "Floyd Shackelford" writes: > how do i manipulate the POINT data type in a select statement? how do i > reference the X and Y portions of the point? for instance, can i select the > X or Y portion of a POINT? Yeah, pretend it's an array with indexes 0,1. regression=# create table p (f1 point); CREATE TABLE regression=# insert into p values('(12,34)'); INSERT 437746 1 regression=# select f1[0] from p; f1 ---- 12 (1 row) regression=# select f1[1] from p; f1 ---- 34 (1 row) regression=# update p set f1[1] = 55; UPDATE 1 regression=# select * from p; f1 --------- (12,55) (1 row) regression=# regards, tom lane