#34955: Make available the string concatenation operator `||` for PostgreSQL
-------------------------------------+-------------------------------------
Reporter: Paolo | Owner: nobody
Melchiorre |
Type: New | Status: new
feature |
Component: Database | Version: dev
layer (models, ORM) | Keywords: field, database,
Severity: Normal | generated, output_field
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The `django.db.models.functions.Concat` database ORM function in the
PostgreSQL database backend use the `CONCAT` SQL function.
Unfortunately, the `CONCAT` function in PostgreSQL is not `IMMUTABLE` and
cannot be used in functional indexes or generated fields.
For example, if you use `Concat("first_name", Value(" "), "last_name")` in
a `GeneratedField` you get the following error:
{{{
#!python
psycopg.errors.InvalidObjectDefinition: generation expression is not
immutable
}}}
I propose to make the string concatenation operator `||` available in the
PostgreSQL database backend in addition to the already available string
concatenation function `CONCAT`.
--
Ticket URL: <https://code.djangoproject.com/ticket/34955>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018bae1a12f3-c3244b1e-48fc-4281-baba-56c9d19a1110-000000%40eu-central-1.amazonses.com.