From 51f6c898893ca660659a24401f7f06d1d29da606 Mon Sep 17 00:00:00 2001
From: Dirk Engling <erdgeist@erdgeist.org>
Date: Sat, 28 Feb 2026 00:14:06 +0100
Subject: The year flags now have become int4multirange

---
 src/postprocess/postgres.sql | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'src/postprocess/postgres.sql')

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 @@
 \timing on
 
+CREATE EXTENSION IF NOT EXISTS pg_trgm;
+CREATE EXTENSION IF NOT EXISTS btree_gin;
+
+-- # Clean up the old ones
+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;
+
 CREATE TABLE telefonbuch (
     id SERIAL PRIMARY KEY,
-    presence_flag bigint,
-    reverse_flag bigint,
-    biz_flag bigint,
+    presence_flag int4multirange,
+    reverse_flag int4multirange,
+    biz_flag int4multirange,
     zip character varying(64)[] DEFAULT '{}',
     nachname character varying(256)[] DEFAULT '{}',
     vorname character varying(192)[] DEFAULT '{}',
@@ -22,9 +28,6 @@ CREATE TABLE telefonbuch (
 
 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 '';
 
--- # Clean up the old ones
-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;
-
 -- # tables we use for indexing
 CREATE TABLE table_nachname   ( telefonbuch_id integer, offs integer, value text);
 CREATE TABLE table_vorname    ( telefonbuch_id integer, offs integer, value text);
-- 
cgit v1.2.3

