diff options
Diffstat (limited to 'src/postprocess')
| -rw-r--r-- | src/postprocess/postgres.sql | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/postprocess/postgres.sql b/src/postprocess/postgres.sql index 3c891d4..ec42a22 100644 --- a/src/postprocess/postgres.sql +++ b/src/postprocess/postgres.sql | |||
| @@ -1,10 +1,16 @@ | |||
| 1 | \timing on | 1 | \timing on |
| 2 | 2 | ||
| 3 | CREATE EXTENSION IF NOT EXISTS pg_trgm; | ||
| 4 | CREATE EXTENSION IF NOT EXISTS btree_gin; | ||
| 5 | |||
| 6 | -- # Clean up the old ones | ||
| 7 | DROP TABLE IF EXISTS Telefonbuch, table_nachname, table_vorname, table_zusaetze, table_strasse, table_hausnummer, table_zip, table_ort, table_verweise, table_vorwahl, table_rufnummer, table_web, table_email; | ||
| 8 | |||
| 3 | CREATE TABLE telefonbuch ( | 9 | CREATE TABLE telefonbuch ( |
| 4 | id SERIAL PRIMARY KEY, | 10 | id SERIAL PRIMARY KEY, |
| 5 | presence_flag bigint, | 11 | presence_flag int4multirange, |
| 6 | reverse_flag bigint, | 12 | reverse_flag int4multirange, |
| 7 | biz_flag bigint, | 13 | biz_flag int4multirange, |
| 8 | zip character varying(64)[] DEFAULT '{}', | 14 | zip character varying(64)[] DEFAULT '{}', |
| 9 | nachname character varying(256)[] DEFAULT '{}', | 15 | nachname character varying(256)[] DEFAULT '{}', |
| 10 | vorname character varying(192)[] DEFAULT '{}', | 16 | vorname character varying(192)[] DEFAULT '{}', |
| @@ -22,9 +28,6 @@ CREATE TABLE telefonbuch ( | |||
| 22 | 28 | ||
| 23 | COPY Telefonbuch ( presence_flag, reverse_flag, biz_flag, zip, nachname, vorname, zusaetze, strasse, hausnummer, verweise, ort, vorwahl, rufnummer, web, email, coords ) FROM '/Users/erdgeist/Coding/Telefonbuch/work/telefonbuch.txt' WITH NULL AS ''; | 29 | COPY Telefonbuch ( presence_flag, reverse_flag, biz_flag, zip, nachname, vorname, zusaetze, strasse, hausnummer, verweise, ort, vorwahl, rufnummer, web, email, coords ) FROM '/Users/erdgeist/Coding/Telefonbuch/work/telefonbuch.txt' WITH NULL AS ''; |
| 24 | 30 | ||
| 25 | -- # Clean up the old ones | ||
| 26 | DROP TABLE IF EXISTS table_nachname, table_vorname, table_zusaetze, table_strasse, table_hausnummer, table_zip, table_ort, table_verweise, table_vorwahl, table_rufnummer, table_web, table_email; | ||
| 27 | |||
| 28 | -- # tables we use for indexing | 31 | -- # tables we use for indexing |
| 29 | CREATE TABLE table_nachname ( telefonbuch_id integer, offs integer, value text); | 32 | CREATE TABLE table_nachname ( telefonbuch_id integer, offs integer, value text); |
| 30 | CREATE TABLE table_vorname ( telefonbuch_id integer, offs integer, value text); | 33 | CREATE TABLE table_vorname ( telefonbuch_id integer, offs integer, value text); |
