Thread: box function implemented?

box function implemented?

From
wsheldah@lexmark.com
Date:
I think I found a glitch either in the box function or in the docs for
postgresql 7.3.2. The online docs say that the box function can find the
intersection box between two boxes. I created a table that looks like this:
CREATE TABLE boxtest (id serial primary key, b1 box, b2 box);

and inserted a row with boxes for b1 and b2. All seemed great. But when I
try:
SELECT box(b1, b2) from boxtest;

I get this error:
Function box(box, box) does not exist

Followed by a couple more lines suggesting I use typecasts. But the docs at
http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=functions-geometry.html
 give exactly that prototype for the box function.

Having said all that, I have to say that postgresql's geometry functions
are fantastic. I just came up with my first need for them, and it looks
like they're going to really save me from writing a chunk of code and speed
things up. Thanks!

Wes


Re: box function implemented?

From
Tom Lane
Date:
wsheldah@lexmark.com writes:
> I think I found a glitch either in the box function or in the docs for
> postgresql 7.3.2. The online docs say that the box function can find the
> intersection box between two boxes.

Looks like it should be referring to box_intersect().  Will fix the docs
--- thanks for catching this!

> Having said all that, I have to say that postgresql's geometry functions
> are fantastic. I just came up with my first need for them, and it looks
> like they're going to really save me from writing a chunk of code and speed
> things up. Thanks!

FWIW, I don't have a whole lot of confidence in the built-in geometric
functions.  They started as an academic exercise (like the rest of
Postgres) but have not been wrung out the way the rest of the system
has.  It seems like everyone who uses them finds more bugs.  So use 'em,
by all means, but test before you trust.

You might also care to look at PostGIS, which has the intention of being
industrial-strength code.  I'm not sure what their level of wrung-out-ness
really is at the moment, but at least there are people actively working
on that code.

            regards, tom lane