Re: PL/pgsql function handle CUBE values

From: Rajarshi Guha <rguha(at)indiana(dot)edu>
To: Colin Wetherbee <cww(at)denterprises(dot)org>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: PL/pgsql function handle CUBE values
Date: 2008-01-16 20:43:56
Message-ID: 2CBE7C69-8ED9-4ECD-B9C8-96C423D1069D@indiana.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Jan 16, 2008, at 3:41 PM, Colin Wetherbee wrote:

> Rajarshi Guha wrote:
>> Hi, I am trying to write a PL/pgsql function that will take a CUBE
>> variable (which will be a 1D point) and a double precision variable.
>> If the input CUBE is defined as
>> '(x,y,z)'::cube
>> the function would then return a CUBE value of the form
>> '(x+R,y+R,z+R),(x-R,y-R,z-R)'::cube
>> where R is the second argument.
>> The problem I'm having is to actually add R to the individual
>> components of the CUBE variable. I can't cast CUBE to float[] and
>> I don't see anyway to get at the individual components of the CUBE.
>
> I haven't tested this, but it looks like you can use cube_subset()
> to do that.
>
> From [0]:
>
> cube_subset(cube, int[]) returns cube
>
> Further, it looks like you're actually trying to create a function
> that will do precisely what cube_enlarge() does.

Indeed! sorry for not giving the docs a thorough a reading

Thanks for the pointer

-------------------------------------------------------------------
Rajarshi Guha <rguha(at)indiana(dot)edu>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
...but there was no one in it.......
- RG

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-01-16 20:51:16 Re: postgresql in FreeBSD jails: proposal
Previous Message Colin Wetherbee 2008-01-16 20:41:14 Re: PL/pgsql function handle CUBE values