On Mar 23, 2006, at 1:35 , Richard Jones wrote:
select countryid from iptocountry where network >> '1.2.3.4';
Is there a suitable index that I can put on the network field to fix
this?
Have you taken a look at the ip4r pgfoundry project?
http://pgfoundry.org/projects/ip4r/
From the READM
<[EMAIL PROTECTED]> To:
pgsql-general@postgresql.org
Sent by: cc:
Richard Jones <[EMAIL PROTECTED]> writes:
> select countryid from iptocountry where network >> '1.2.3.4';
> Is there a suitable index that I can put on the network field to fix
> this?
Not at the moment :-(. I think it might be possible to write a GIST
opclass that could handle this, but there
I've got a table like this:
create table iptocountry (
network inet not null,
countryid int not null references countries (id)
);
The idea is that it contains mappings from IP address ranges to
countries, something like this:
insert into iptocountry values ('1.2.3.0/24', 33);
It