the real deal geoipdata
This commit is contained in:
parent
7a991a8032
commit
f0a0f9f2f2
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1 @@
|
|||
this is just for getting this maxmind data over there so i can use it.
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
-- to load the geoip data:
|
||||
-- psql -U postgres -d geoip -f GeoIPLocations.sql
|
||||
-- psql -U postgres -d geoip -f GeoIPBlocks.sql
|
||||
-- psql -U postgres -d geoip -f GeoIPISP.sql
|
||||
-- psql -U postgres -d geoip -f supplement.sql
|
||||
|
||||
DELETE FROM jamcompany;
|
||||
ALTER SEQUENCE jamcompany_coid_seq RESTART WITH 1;
|
||||
INSERT INTO jamcompany (company) SELECT DISTINCT company FROM geoipisp ORDER BY company;
|
||||
|
||||
DELETE FROM jamisp;
|
||||
INSERT INTO jamisp (beginip, endip, coid) SELECT x.beginip, x.endip, y.coid FROM geoipisp x, jamcompany y WHERE x.company = y.company;
|
||||
|
||||
ALTER TABLE geoiplocations DROP COLUMN geog;
|
||||
ALTER TABLE geoiplocations ADD COLUMN geog geography(point, 4326);
|
||||
UPDATE geoiplocations SET geog = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326)::geography;
|
||||
CREATE INDEX geoiplocations_geog_gix ON geoiplocations USING GIST (geog);
|
||||
|
||||
ALTER TABLE geoipblocks DROP COLUMN geom;
|
||||
ALTER TABLE geoipblocks ADD COLUMN geom geometry(polygon);
|
||||
UPDATE geoipblocks SET geom = ST_MakeEnvelope(beginip, -1, endip, 1);
|
||||
CREATE INDEX geoipblocks_geom_gix ON geoipblocks USING GIST (geom);
|
||||
|
||||
ALTER TABLE jamisp DROP COLUMN geom;
|
||||
ALTER TABLE jamisp ADD COLUMN geom geometry(polygon);
|
||||
UPDATE jamisp SET geom = ST_MakeEnvelope(beginip, -1, endip, 1);
|
||||
CREATE INDEX jamisp_geom_gix ON jamisp USING GIST (geom);
|
||||
|
||||
VACUUM ANALYSE;
|
||||
Loading…
Reference in New Issue