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


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to