Re: Determining if two subnets intersect

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Determining if two subnets intersect
Дата
Msg-id 20287.996043766@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Determining if two subnets intersect  (Florian Weimer <Florian.Weimer@RUS.Uni-Stuttgart.DE>)
Ответы Re: Determining if two subnets intersect  (Florian Weimer <Florian.Weimer@RUS.Uni-Stuttgart.DE>)
Список pgsql-sql
Florian Weimer <Florian.Weimer@RUS.Uni-Stuttgart.DE> writes:
> Is there some efficient PostgreSQL expression which is true if and
> only if two subnets (given as values of type cidr) have non-empty
> intersection (even if the intersection is not a CIDR network)?

Maybe I'm missing something, but ISTM it's only possible for two
CIDR subnets to overlap if one contains the other.  So you could
check with
    A <<= B OR B <<= A
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Henry House
Дата:
Сообщение: Re: nextval on insert by arbitrary sequence
Следующее
От: Florian Weimer
Дата:
Сообщение: Re: Determining if two subnets intersect