Re: Range-Types in 9.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marc Mamin" <M(dot)Mamin(at)intershop(dot)de>
Cc: "Jeff Davis" <pgsql(at)j-davis(dot)com>, "Andreas Kretschmer" <andreas(at)a-kretschmer(dot)de>, "pg-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Range-Types in 9.2
Date: 2012-08-03 18:25:16
Message-ID: 4095.1344018316@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Marc Mamin" <M(dot)Mamin(at)intershop(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2012-08-03 20:00:13 Another question about Range types
Previous Message Marc Mamin 2012-08-03 18:08:15 Re: Range-Types in 9.2