diff options
| author | Mads Jensen <mje@inducks.org> | 2016-06-01 23:43:59 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-21 12:11:37 -0400 |
| commit | 094d630ae8d8e5e68817c313da0fd737898b216b (patch) | |
| tree | b9ddc286156eaf775f82b51c124816f9e366f77f /docs | |
| parent | 7eda99f03f6dfbd5a4a3f1e40e6d51842fd3268f (diff) | |
Fixed #26610 -- Added CITextField to contrib.postgres.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/postgres/fields.txt | 20 | ||||
| -rw-r--r-- | docs/ref/contrib/postgres/operations.txt | 9 | ||||
| -rw-r--r-- | docs/releases/1.11.txt | 5 |
3 files changed, 34 insertions, 0 deletions
diff --git a/docs/ref/contrib/postgres/fields.txt b/docs/ref/contrib/postgres/fields.txt index 3d22b13577..93f14fcca0 100644 --- a/docs/ref/contrib/postgres/fields.txt +++ b/docs/ref/contrib/postgres/fields.txt @@ -250,6 +250,26 @@ At present using :attr:`~django.db.models.Field.db_index` will create a A more useful index is a ``GIN`` index, which you should create using a :class:`~django.db.migrations.operations.RunSQL` operation. +``CITextField`` +=============== + +.. class:: CITextField(**options) + + .. versionadded:: 1.11 + + This field is a subclass of :class:`~django.db.models.CharField` backed by + the citext_ type, a case-insensitive character string type. Read about `the + performance considerations`_ prior to using this field. + + To use this field, setup the ``citext`` extension in PostgreSQL before the + first ``CreateModel`` migration operation using the + :class:`~django.contrib.postgres.operations.CITextExtension` operation. The + code to setup the extension is similar to the example for + :class:`~django.contrib.postgres.fields.HStoreField`. + + .. _citext: https://www.postgresql.org/docs/current/static/citext.html + .. _the performance considerations: https://www.postgresql.org/docs/current/static/citext.html#AEN169274 + ``HStoreField`` =============== diff --git a/docs/ref/contrib/postgres/operations.txt b/docs/ref/contrib/postgres/operations.txt index 656be8e976..4dcc85105f 100644 --- a/docs/ref/contrib/postgres/operations.txt +++ b/docs/ref/contrib/postgres/operations.txt @@ -27,6 +27,15 @@ the ``django.contrib.postgres.operations`` module. Install the ``btree_gin`` extension. +``CITextExtension`` +=================== + +.. class:: CITextExtension() + + .. versionadded:: 1.11 + + Installs the ``citext`` extension. + ``HStoreExtension`` =================== diff --git a/docs/releases/1.11.txt b/docs/releases/1.11.txt index 307ed9ab52..4b17754cde 100644 --- a/docs/releases/1.11.txt +++ b/docs/releases/1.11.txt @@ -160,6 +160,11 @@ Minor features parameter to specify a custom class to encode data types not supported by the standard encoder. +* The new :class:`~django.contrib.postgres.fields.CITextField` and + :class:`~django.contrib.postgres.operations.CITextExtension` migration + operation allow using PostgreSQL's ``citext`` extension for case-insensitive + lookups. + :mod:`django.contrib.redirects` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
