Thread: BOX question..

BOX question..

From
Barry Stinson
Date:
Hey guys:

I've searched google and postgresql.org but havent found
an answer to this:

The documentation states that the BOX data-type stores
the information as (1st) lower-left corner and (2nd)
upper-right corner.

However, when I try to insert a BOX pair, I get the
reverse. ie...

---------------------------------------------
     insert into test values ('(1,1),(10,10)');
     select * from test;

        thebox
     ------------
     (10,10),(1,1)
---------------------------------------------

(This is on ver 7.02, incidentally)

Wouldn't that be the opposite? Lower right, then upper
left? Is this just a bug in the documentation?

--Thanks
--Barry Stinson


Re: BOX question..

From
Tom Lane
Date:
Barry Stinson <bas@loganfoundation.org> writes:
> The documentation states that the BOX data-type stores
> the information as (1st) lower-left corner and (2nd)
> upper-right corner.
> Wouldn't that be the opposite? Lower right, then upper
> left? Is this just a bug in the documentation?

The code clearly stores the 'high' corner first, then the 'low' corner.

If we weren't just about to make a release, I'd be tempted to change
the code to match the documentation, since low-first would seem like
the obvious representation.  But I suppose we'd better do the
conservative thing and change the docs ...

            regards, tom lane