Re: point -> double,double ? - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: point -> double,double ?
Date
Msg-id 20030117194044.GB3839@wolff.to
Whole thread Raw
In response to point -> double,double ?  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
On Fri, Jan 17, 2003 at 14:04:21 -0500,
  Greg Stark <gsstark@mit.edu> wrote:
>
> What are the operators or functions to extract the x and y portions of a
> point? I can't find it in my book or in the online \do or \df output anywhere.

One way to do it is the following:
bruno=> select height(box('(0,0)','(1,2)'));
 height
--------
      2
(1 row)

bruno=> select width(box('(0,0)','(1,2)'));
 width
-------
     1
(1 row)

Replace the the non '(0,0)' point with the point of interest.

This only works for nonnegative values.

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: point -> double,double ?
Next
From: Tom Lane
Date:
Subject: Re: point -> double,double ?