Re: Range Types and extensions

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Range Types and extensions
Дата
Msg-id BANLkTi=4_D0QD1EZoLEcnFZBG9xJT-cdew@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Range Types and extensions  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Range Types and extensions  (Florian Pflug <fgp@phlo.org>)
Список pgsql-hackers
On Mon, Jun 20, 2011 at 11:21 AM, Jeff Davis <pgsql@j-davis.com> wrote:
> On Mon, 2011-06-20 at 16:01 +0200, Florian Pflug wrote:
>> Hm, I'm starting to wonder if there isn't a way around that. It seems that
>> this restriction comes from the desire to allow functions with the
>> polymorphic signature
>>   (ANYELEMENT, ANYELEMENT) -> ANYRANGE.
>>
>> The only such function I can currently come up with is the generic
>> range constructor. Is having that worth the restriction to one
>> range type per base type?
>
> Good point.
>
> Having constructors is obviously important, but perhaps they don't have
> to be generic. We could generate catalog entries for each constructor
> for each range type, and name them after the range type itself. So,
> instead of:
>  range(1, 10)
> you'd write:
>  int4range(1,10)
>
> That actually might be better anyway, because relying on the polymorphic
> version is not perfect now anyway. For instance, if you want an
> int8range using the generic range() constructor, you need a cast.
>
> We'd still need to get the polymorphic type system to work the way we
> want in this case. I'll look into that.

hm, what if there *was( only one range type per base type, but in the
various contexts where specific ordering and collation was important
you could optionally pass them in?  Meaning, the specific ordering was
not bound rigidly to the type, but to the operation?

merlin


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Fixed string in German translation that causes segfault.
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: ALTER TABLE lock strength reduction patch is unsafe