﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35368	Postgres schema test failure locally	bcail	nobody	"The error is below. I bisected to commit 888b9042b3598bab6557c62de82505eec9ea62ed where the test started failing for me. I'm on Linux, using Postgres 15.
{{{
ERROR: test_add_generated_field (schema.tests.SchemaTests.test_add_generated_field)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/opt/local/src/django/django/db/backends/utils.py"", line 103, in _execute
    return self.cursor.execute(sql)
    ^^^^^^^^^^^^^^^^^
psycopg2.errors.IndeterminateCollation: could not determine which collation to use for upper() function
HINT:  Use the COLLATE clause to set the collation explicitly.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File ""/opt/python-3.12/lib/python3.12/unittest/case.py"", line 58, in testPartExecutor
    yield
  File ""/opt/python-3.12/lib/python3.12/unittest/case.py"", line 636, in run
    self._callTestMethod(testMethod)
    ^^^^^^^^^^^^^^^^^
  File ""/opt/python-3.12/lib/python3.12/unittest/case.py"", line 589, in _callTestMethod
    if method() is not None:
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/test/utils.py"", line 446, in inner
    return func(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/test/testcases.py"", line 1548, in skip_wrapper
    return test_func(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/tests/schema/tests.py"", line 923, in test_add_generated_field_contains
    editor.add_field(GeneratedFieldContainsModel, field)
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/db/backends/base/schema.py"", line 754, in add_field
    self.execute(sql, params or None)
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/db/backends/postgresql/schema.py"", line 48, in execute
    return super().execute(sql, None)
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/db/backends/base/schema.py"", line 201, in execute
    cursor.execute(sql, params)
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/db/backends/utils.py"", line 79, in execute
    return self._execute_with_wrappers(
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/db/backends/utils.py"", line 92, in _execute_with_wrappers
    return executor(sql, params, many, context)
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/db/backends/utils.py"", line 100, in _execute
    with self.db.wrap_database_errors:
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/db/utils.py"", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    ^^^^^^^^^^^^^^^^^
  File ""/opt/local/src/django/django/db/backends/utils.py"", line 103, in _execute
    return self.cursor.execute(sql)
    ^^^^^^^^^^^^^^^^^
django.db.utils.ProgrammingError: could not determine which collation to use for upper() function
HINT:  Use the COLLATE clause to set the collation explicitly.
}}}"	Bug	closed	Database layer (models, ORM)	dev	Normal	duplicate		bcail Simon Charette	Accepted	0	0	0	0	0	0
