Help for this page

Select Code to Download


  1. or download this
    SELECT country_code, city_name, latitude, longitude, radius FROM geoip WHERE ? << netblock LIMIT 1
  2. or download this
    CREATE INDEX geoip_netblock_idx ON geoip USING GIST(netblock inet_ops);
  3. or download this
    Cables_DB=# SELECT country_code, city_name, latitude, longitude, radiu
    +s FROM geoip WHERE '8.8.8.8' << netblock LIMIT 1;
     country_code | city_name | latitude | longitude | radius 
    --------------+-----------+----------+-----------+--------
    ...
       ->  Index Scan using geoip_netblock_idx on geoip  (cost=0.41..8.43 
    +rows=1 width=35)
             Index Cond: ((netblock)::inet >> '8.8.8.8'::inet)
    (3 rows)