Re: [GENERAL] appropriate column for storing ipv4 address
| От | Paul Jungwirth |
|---|---|
| Тема | Re: [GENERAL] appropriate column for storing ipv4 address |
| Дата | |
| Msg-id | 0af9b9a3-2b7d-65df-a25e-a310f5e4aa27@illuminatedcomputing.com обсуждение |
| Ответ на | [GENERAL] appropriate column for storing ipv4 address (jonathan vanasco <postgres@2xlp.com>) |
| Ответы |
Re: [GENERAL] appropriate column for storing ipv4 address
|
| Список | pgsql-general |
On 03/01/2017 08:39 AM, jonathan vanasco wrote: > > I have to store/search some IP data in Postgres 9.6 and am second-guessing my storage options. > > Would anyone mind giving this a quick look for me? > > Right now I have two tables, and am just using cidr for both: Hi Jonathan, CIDR seems like a better match to how people think about IPs, but another option would be to use a custom range type on inet. I wrote a blog post about that here, including how to use a GiST index to get fast searches: http://illuminatedcomputing.com/posts/2016/06/inet-range/ Maybe it will be useful for you! Or maybe there is already some built-in way to treat cidr columns like ranges? Paul
В списке pgsql-general по дате отправления: