Re: Obstacles to user-defined range canonicalization functions - Mailing list pgsql-hackers

From Florian Pflug
Subject Re: Obstacles to user-defined range canonicalization functions
Date
Msg-id 30EF645F-F3EB-4349-997E-F9B0E3FFC909@phlo.org
Whole thread Raw
In response to Obstacles to user-defined range canonicalization functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Obstacles to user-defined range canonicalization functions
Next
From: "David E. Wheeler"
Date:
Subject: Re: Obstacles to user-defined range canonicalization functions