|
|
|
|
@ -3,13 +3,12 @@
|
|
|
|
|
- python 3.7
|
|
|
|
|
- postgresql 12
|
|
|
|
|
|
|
|
|
|
### Database schema
|
|
|
|
|
includes GIN index column `geodata_search_idx`
|
|
|
|
|
```sql
|
|
|
|
|
ALTER TABLE geodata ADD COLUMN geodata_search_ts TSVECTOR
|
|
|
|
|
GENERATED ALWAYS AS (to_tsvector('russian', geodata.description) STORED
|
|
|
|
|
```
|
|
|
|
|
(use coalese() if multiple)
|
|
|
|
|
```sql
|
|
|
|
|
CREATE INDEX geodata_search_idx ON geodata USING GIN (geodata_search_ts);
|
|
|
|
|
# Known issues
|
|
|
|
|
- ```
|
|
|
|
|
ERROR: duplicate key value violates unique constraint "pg_type_typname_nsp_index"
|
|
|
|
|
DETAIL: Key (typname, typnamespace)=(headers, 2200) already exists.
|
|
|
|
|
```
|
|
|
|
|
at the first database init.
|
|
|
|
|
https://www.postgresql.org/message-id/28194.1101582367%40sss.pgh.pa.us
|
|
|
|
|
Simple restart seems to fix it.
|
|
|
|
|
Use of Alembic might help
|