Re: point -> double,double ?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: point -> double,double ?
Date: 2003-01-17 19:40:44
Message-ID: 20030117194044.GB3839@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 17, 2003 at 14:04:21 -0500,
Greg Stark <gsstark(at)mit(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2003-01-17 20:02:55 Re: point -> double,double ?
Previous Message Steve Crawford 2003-01-17 19:37:26 Terrible performance on wide selects