Re: Why so few built-in range types?

Поиск
Список
Период
Сортировка
Искать
От
Robert Haas
Тема
Re: Why so few built-in range types?
Дата
Msg-id
CA+TgmoYY-dy8LPp+Y_T2GxyuDh7k35BzqwD9jdo+jhaOi+R+Ow@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Re: Why so few built-in range types? karavelov@mail.bg
On Wed, Nov 30, 2011 at 1:08 PM, Jeff Davis  wrote:
> One that I'd like to see is an IP address type, but that's complicated
> because inet and cidr support netmasks.

A CIDR address defines a range all by itself, without packing any
other type on top.  It just needs GIST support, and an indexable
operator for "contains or is contained by"; then, you can define an
exclusion constraint over a CIDR column to enforce a
no-duplicate-or-overlapping-IP-ranges rule.  I started working on that
at one point, but I didn't have as much enthusiasm as the task needed
so I gave up before accomplishing anything particularly useful.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

В списке pgsql-hackers по дате отправления
От: Pavel Stehule
Дата:
От: Tom Lane
Дата:
FAQ