Search Postgresql Archives

Re: appropriate column for storing ipv4 address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Mar 1, 2017, at 8:39 AM, jonathan vanasco <postgres@xxxxxxxx> 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 block for 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 that the 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/ip4r as a possible alternative.

Cheers,
  Steve

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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux