Re: Range-Types in 9.2 - Mailing list pgsql-general

From Tom Lane
Subject Re: Range-Types in 9.2
Date
Msg-id 4095.1344018316@sss.pgh.pa.us
Whole thread Raw
In response to Re: Range-Types in 9.2  ("Marc Mamin" <M.Mamin@intershop.de>)
List pgsql-general
"Marc Mamin" <M.Mamin@intershop.de> writes:
> Is there some logical reason why no function width(range) was added to the bundle ?

It's not well-defined for all base types.  A range type only presumes
the underlying type has comparison, not that it has subtraction.
Moreover, there's no way to define range(anyrange) polymorphically,
because the types that do have subtraction don't necessarily have
operators that return the same type.  (timestamptz being the first
counterexample.)

            regards, tom lane

pgsql-general by date:

Previous
From: "Marc Mamin"
Date:
Subject: Re: Range-Types in 9.2
Next
From: Mike Christensen
Date:
Subject: Another question about Range types