From: Nicolas Boisselier Date: Thu, 4 Jan 2018 19:36:14 +0000 (+0000) Subject: share/sql/geo.sql X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=a0bc1ca4928edc40621fa2653eae8ade1647d227;p=nb.git share/sql/geo.sql --- diff --git a/share/sql/geo.sql b/share/sql/geo.sql index c567b051..655caf0b 100644 --- a/share/sql/geo.sql +++ b/share/sql/geo.sql @@ -42,7 +42,7 @@ CREATE TABLE IF NOT EXISTS geo ( GRANT ALL ON ALL TABLES IN SCHEMA public TO www; GRANT ALL ON ALL TABLES IN SCHEMA public TO nico; GRANT ALL ON ALL TABLES IN SCHEMA public TO root; -CREATE INDEX geo_country_idx ON geo (country); +CREATE INDEX IF NOT EXISTS geo_country_idx ON geo (country); BEGIN TRANSACTION; DELETE FROM geo; COPY geo FROM PROGRAM 'curl -s http://download.geonames.org/export/dump/allCountries.zip | zcat' WITH (format 'text', NULL '');