# Using GeneratedField with Postgres

**URL:** <https://forum.djangoproject.com/t/using-generatedfield-with-postgres/27224>\
**Category:** ORM\
**Created:** [January 20, 2024, 5:34pm UTC](https://forum.djangoproject.com/t/using-generatedfield-with-postgres/27224 "2024-01-20T17:34:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![felixxm](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/felixxm/32/2479_2.png) [@felixxm](https://forum.djangoproject.com/u/felixxm)\
**Post date:** [January 20, 2024, 6:06pm UTC](https://forum.djangoproject.com/t/using-generatedfield-with-postgres/27224/2 "2024-01-20T18:06:26Z")

</div>

PostgreSQL requires functions and operators referenced in a generated column to be marked as `IMMUTABLE`. Unfortunately, PostgreSQL’s `CONCAT` is not considered an immutable, that’s why in Django 5.1 we’ve changed the implementation of Django’s `Concat()` to use `||`

> <https://github.com/django/django/commit/6364b6ee1071381eb3a23ba6b821fc0d6f0fce75>
>
> This also avoids casting string based expressions in Concat() on
> PostgreSQL.

---

_[View the full topic](https://forum.djangoproject.com/t/using-generatedfield-with-postgres/27224)._
