From c6e877b75eb6098fe75911e2e45d8ba2503f7aab Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 5 Jan 2018 14:05:16 +0000 Subject: [PATCH] lib/postgres/lang.sql --- lib/postgres/lang.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/postgres/lang.sql b/lib/postgres/lang.sql index 125fd6bf..3a166551 100644 --- a/lib/postgres/lang.sql +++ b/lib/postgres/lang.sql @@ -1,9 +1,12 @@ DROP TABLE IF EXISTS lang; CREATE TABLE IF NOT EXISTS lang ( - id bigint PRIMARY KEY, + id char(3) PRIMARY KEY, name varchar(200) ); +GRANT ALL ON TABLE lang TO www; +GRANT ALL ON TABLE lang TO nico; +GRANT ALL ON TABLE lang TO root; BEGIN TRANSACTION; DELETE FROM lang; -COPY lang FROM PROGRAM 'curl -s //download.geonames.org/export/dump/alternateNames.zip | zcat | cut -f 1,4' WITH (format 'text', NULL ''); +COPY lang FROM PROGRAM 'curl -s http://download.geonames.org/export/dump/iso-languagecodes.txt | tail -n +2 | cut -f 1,4' WITH (format 'text', NULL ''); COMMIT; -- 2.47.3