On Tue, Jul 5, 2016 at 3:28 PM, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> On Tue, Jul 5, 2016 at 5:37 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Paul Jungwirth <pj@illuminatedcomputing.com> writes:
>> > The problem is this (tried on 9.3 and 9.5):
>>
>> The only other obvious way to deal with this is to allow the canonical
>> function to be defined after the range type is created, and then added to
>> the type via an ALTER TYPE command.
>
> Can the canonical function be definitionally optional but runtime required?
Thanks Tom and David for your help! I actually tried to find something
in ALTER TYPE that would do just that, but of course it's not there.
It seems like an appealing solution though.
With Tom's warning that a shell type would require writing the
function in C, I figured I might as well just package it all up as an
extension, so here it is:
https://github.com/pjungwir/inetrange
Of course it still requires superuser privileges, but as least the C
part is just `make && sudo make install`.
Thanks again!
Paul