Re: [HACKERS] Obstacles to user-defined range canonicalization functions

2011-11-24 Thread Jeff Davis
On Wed, 2011-11-23 at 22:33 -0500, Tom Lane wrote: > * The underlying range_serialize function is only exposed at the C > level. If you try to write something in, say, plpgsql then you are > going to end up going through range_constructorN or range_in to produce > your result value, and those call

Re: [HACKERS] Obstacles to user-defined range canonicalization functions

2011-11-23 Thread David E. Wheeler
On Nov 23, 2011, at 10:33 PM, Tom Lane wrote: > Now you could argue that for performance reasons everybody should write > their canonicalization functions in C anyway, but I'm not sure I buy > that --- at the very least, it'd be nice to write the functions in > something higher-level while prototy

Re: [HACKERS] Obstacles to user-defined range canonicalization functions

2011-11-23 Thread Florian Pflug
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 canonicalizati

[HACKERS] Obstacles to user-defined range canonicalization functions

2011-11-23 Thread Tom Lane
I got religion this evening about the potential usefulness of user-defined canonicalization functions --- the example that did it for me was thinking about a range type over timestamp that quantizes boundaries to hours, or half hours, or 15 minutes, or any scheduling unit that is standard in a part