Search Postgresql Archives

Re: Get closest numbers between intervals

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

 



xaviergxf <xaviergxf@xxxxxxxxx> writes:
> city_code, start_ip, end_ip
>
> I´m searching for the city that its between two ip´s. But, i would
> like to get the nearest´s cities too.

I'd have a look at ip4r rather than having both the start and end ip
there. The GiST index on ip4r allow for quick lookup:

  SELECT * FROM ... WHERE iprange >>= '1.2.3.4'::ip4;

  http://pgfoundry.org/projects/ip4r/

> Any ideas how can i search for the city proximity?

I'd have a look at earthdistance contrib, then maybe PostGIS:

  http://www.postgresql.org/docs/8.4/static/earthdistance.html

Regards,
-- 
dim

-- 
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