Re: [GENERAL] appropriate column for storing ipv4 address

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: [GENERAL] appropriate column for storing ipv4 address
Дата
Msg-id ABDAA428-A7AE-4E99-ABD5-16B1407B8DA4@blighty.com
обсуждение исходный текст
Ответ на [GENERAL] appropriate column for storing ipv4 address  (jonathan vanasco <postgres@2xlp.com>)
Список pgsql-general
> On Mar 1, 2017, at 8:39 AM, jonathan vanasco <postgres@2xlp.com> wrote:
>
>
> I have to store/search some IP data in Postgres 9.6 and am second-guessing my storage options.
>
>
> The types of searching I'm doing:

[...]

>
>     2. on tracked_ip_block, i search/join against the tracked_ip_address to show known ips in a block, or a known
blockfor an ip. 
>
> i used cidr instead of inet for the ip_address because it saved me a cast on joins and appears to work the same.  was
thatthe right move?  is there a better option? 

If you're looking to do fast searches for "is this IP address in any of these CIDR blocks" you might want to look at
https://github.com/RhodiumToad/ip4ras a possible alternative. 

Cheers,
  Steve

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

Предыдущее
От: Paul Jungwirth
Дата:
Сообщение: Re: [GENERAL] appropriate column for storing ipv4 address
Следующее
От: jonathan vanasco
Дата:
Сообщение: Re: [GENERAL] disk writes within a transaction