1 -- SPDX-License-Identifier: GPL-2.0-only
3 -- This file is part of Nominatim. (https://nominatim.org)
5 -- Copyright (C) 2022 by the Nominatim developer community.
6 -- For a full list of authors see the git log.
8 DROP TABLE IF EXISTS word;
11 word_token text NOT NULL,
15 ) {{db.tablespace.search_data}};
17 CREATE INDEX idx_word_word_token ON word
18 USING BTREE (word_token) {{db.tablespace.search_index}};
19 -- Used when updating country names from the boundary relation.
20 CREATE INDEX idx_word_country_names ON word
21 USING btree(word) {{db.tablespace.address_index}}
23 -- Used when inserting new postcodes on updates.
24 CREATE INDEX idx_word_postcodes ON word
25 USING btree(word) {{db.tablespace.address_index}}
27 -- Used when inserting full words.
28 CREATE INDEX idx_word_full_word ON word
29 USING btree(word) {{db.tablespace.address_index}}
31 -- Used when inserting analyzed housenumbers (exclude old-style entries).
32 CREATE INDEX idx_word_housenumbers ON word
33 USING btree(word) {{db.tablespace.address_index}}
34 WHERE type = 'H' and word is not null;
36 GRANT SELECT ON word TO "{{config.DATABASE_WEBUSER}}";
38 DROP SEQUENCE IF EXISTS seq_word;
39 CREATE SEQUENCE seq_word start 1;
40 GRANT SELECT ON seq_word to "{{config.DATABASE_WEBUSER}}";