Re: Range Types, discrete and/or continuous - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Range Types, discrete and/or continuous
Date
Msg-id m2wroy856t.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Range Types, discrete and/or continuous  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> Also, there's a good case for continuous ranges for types like NUMERIC,
> but still continuous ranges don't seem quite as important overall.

Well it seems to me that the prefix_range type is continuous, so I would
tend to disagree here :)

A prefix_range is currently written as e.g. '012[3-5]' but could be
worked out to be represented '0123-0125'. In any case here are some
example of values that are contained in the mentioned range:
 0123 0124 012345 0123456789 0125221956

You get the idea, I suppose. The main use case is telephony routing:
searching for a prefix in your operator table when you know the phone
number that's calling you.

So let's not forget about continuous ranges, because there's at least
one real-world case that needs them. Oh and it's based on text really,
not on numbers, so that could be the range 'abc-abe'.

I'm too tired to try to understand how your proposal fits with what
would be needed to cover prefix ranges tonight, but I wanted to share
the use case at least.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Alex Hunsaker
Date:
Subject: Re: why does plperl cache functions using just a bool for is_trigger
Next
From: Dimitri Fontaine
Date:
Subject: Re: Simplifying replication