#26684: Example for Full-Text Search Index doesn't work
-------------------------------------+-------------------------------------
Reporter: Xof | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 1.10
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Xof):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> The example given for creating an index on a to_tsvector() call doesn't
> actually work, since to_tsvector() is not immutable (the results of it
> can change with changes to the underlying dictionaries it is ruled it is
> built on).
>
> {{{
> xof=# create table t (z text);
> CREATE TABLE
> xof=# create index on t(to_tsvector(z));
> ERROR: functions in index expression must be marked IMMUTABLE
> }}}
>
> (As a note, indexes on `tsvector`s should be GIN indexes rather than
> B-tree.)
>
> For documentation purposes in the release notes, I'd suggest pointing the
> reader to the PostgreSQL documentation that describes how to handle this
> situation.
New description:
The example given for creating an index on a to_tsvector() call doesn't
actually work, since to_tsvector() is not immutable (the results of it can
change with changes to the underlying dictionaries it is ruled it is built
on).
{{{
xof=# create table t (z text);
CREATE TABLE
xof=# create index on t(to_tsvector(z));
ERROR: functions in index expression must be marked IMMUTABLE
}}}
(As a note, indexes on `tsvector`s should be GIN indexes rather than
B-tree.)
For documentation purposes, I'd suggest pointing the reader to the
PostgreSQL documentation that describes how to handle this situation.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/26684#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/061.850d25d456814525d8a63cf713a583c3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.