Re: Getting float8 data into cube?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Getting float8 data into cube?
Date: 2003-01-20 06:09:09
Message-ID: 20030120060909.GA1390@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have a specific proposal for allowing for building cube values from
float8 values with building strings (which will typically lose information).
I want to add the following 4 overloaded functions:

cube(float8)
cube(1) returns '(1),(1)'::cube

cube(float8,float8)
cube(1,2) returns '(1),(2)'::cube

cube(cube,float8)
cube('(1),(2)',3) returns '(1,3),(2,3)'::cube

cube(cube,float8,float8)
cube('(1),(2)',3,4) returns '(1,3),(2,4)'::cube

This is useful when the input needs to be transformed before being stored.
For example when the input is in polar coordinates.

For polar input of R and O, you then could do something like:
cube(cube(R*sin(O)),R*cos(O))
instead of
cube('('||R*sin(O)||','||R*cos(O)||')')
The latter will normally be less accurrate than the former.

If the above is acceptable, I will come up with a patch versus the 7.4
version of the cube contrib package.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Emmanuel Charpentier 2003-01-20 06:13:00 Re: default to WITHOUT OIDS? Possible related problem
Previous Message Dan Langille 2003-01-20 05:01:12 What goes into the security doc?