Re: Obstacles to user-defined range canonicalization functions

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: Obstacles to user-defined range canonicalization functions
Дата
Msg-id 30EF645F-F3EB-4349-997E-F9B0E3FFC909@phlo.org
обсуждение исходный текст
Ответ на Obstacles to user-defined range canonicalization functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Nov24, 2011, at 04:33 , Tom Lane wrote:
> One possibility that just came to me is to decree that every discrete
> range type has to be based on an underlying continuous range type (with
> all the same properties except no canonicalization function), and then
> the discrete range's canonicalization function could be declared to take
> and return the underlying range type instead of the discrete type
> itself.  Haven't worked through the details though.

We could also make the canonicalization function receive the boundaries
and boundary types as separate arguments, and return them in the same way.

In plpgsql the signature could be

canonicalize(inout lower base_type, inout upper base_type,            inout lower_inclusive boolean, inout
upper_inclusiveboolean)
 

Not exactly pretty, but it avoids the need for a second continuous range
type...

best regards,
Florian Pflug



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Obstacles to user-defined range canonicalization functions
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Obstacles to user-defined range canonicalization functions