Changes between Initial Version and Version 1 of Ticket #35262
- Timestamp:
- Feb 29, 2024, 6:29:04 PM (9 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35262
- Property Component Uncategorized → contrib.postgres
-
Ticket #35262 – Description
initial v1 1 Hi,2 3 1 I have created a Gin Index using the folowing code in models.py 4 5 ''GinIndex(OpClass(Lower('historique'), name='gin_trgm_ops'), name="name_gin_trgm_histo_affaire")'' 6 2 {{{#!python 3 GinIndex(OpClass(Lower('historique'), name='gin_trgm_ops'), name="name_gin_trgm_histo_affaire") 4 }}} 7 5 It generates a migration operation : 8 6 9 ''migrations.AddIndex( 10 model_name='affaire', 11 index=django.contrib.postgres.indexes.GinIndex(django.contrib.postgres.indexes.OpClass(django.db.models.functions.text.Lower('historique'), name='gin_trgm_ops'), name='name_gin_trgm_histo_affaire'),12 13 14 '' 7 {{{#!python 8 migrations.AddIndex( 9 model_name='affaire', 10 index=django.contrib.postgres.indexes.GinIndex(django.contrib.postgres.indexes.OpClass(django.db.models.functions.text.Lower('historique'), name='gin_trgm_ops'), name='name_gin_trgm_histo_affaire'), 11 ) 12 }}} 15 13 16 14 The SQL generated instruction is : 17 15 18 19 ''CREATE INDEX "name_gin_trgm_histo_affaire" ON "affaires_affaire" USING gin ((LOWER("historique") gin_trgm_ops));'' 20 16 {{{#!sql 17 CREATE INDEX "name_gin_trgm_histo_affaire" ON "affaires_affaire" USING gin ((LOWER("historique") gin_trgm_ops)); 18 }}} 21 19 It is refused by postgresql. 22 20 23 21 The right code might be : 24 22 {{{#!sql 25 23 CREATE INDEX "name_gin_trgm_histo_affaire" ON "affaires_affaire" USING gin (LOWER("historique") ); 26 24 }}} 27 25 that accepted by postgresql. 28 29 Thanks,30 31 Regards,32 33 34