Postgres 14 fails in median migration
Possibly to be marked as WontFix (apart from docs) due to issue #789 removing the postgres median migration from the process for version 1.0.
Reported by Anthony Morales on Twitter
At the stage of adding the median database function the following error occurs when using PostgreSQL 14.1 (the current latest version at the time of reporting the issue):
(venv) C:\Users\ed\Documents\OpenREM\install0100\venv\Lib\site-packages\openrem>python manage.py migrate
Operations to perform:
Synchronize unmigrated apps: solo, django_filters, staticfiles, messages, humanize, django_js_reverse, crispy_forms
Apply all migrations: remapp, sessions, admin, sites, auth, contenttypes
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states... DONE
Applying remapp.0002_0_7_fresh_install_add_median...Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\ed\Documents\OpenREM\install0100\venv\lib\site-packages\django\core\management\__init__.py", line 354, in execute_from_command_line
utility.execute()
[...]
File "C:\Users\ed\Documents\OpenREM\install0100\venv\lib\site-packages\django\db\backends\utils.py", line 62, in execute
return self.cursor.execute(sql)
django.db.utils.ProgrammingError: function array_append(anyarray, anyelement) does not exist
Running the previous major version instead (13.5) works without issue.
Comments (10)
-
-
reporter I saw that (in the release notes), but it seems to be specific to upgrades between postgres versions, so I didn’t look any further.
-
We could do a check for the PostgreSQL version and if it is 14 then apply a different median function (https://stackoverflow.com/questions/39447836/how-get-postgresql-version-using-psycopg2)
-
reporter But we’re not using this migration in v1.0 are we? So I think we just update the 0.10 docs to stipulate postgres v13 or earlier.
-
reporter Adding note about postgres version. Refs
#928[skip ci] docs only→ <<cset c53ed9de28c4>>
-
reporter Attempt to get old docs to build... refs
#928[skip ci] docs only→ <<cset 7e2a9b87ace5>>
-
reporter - changed status to resolved
Merged in 0.10.0-docs-postgresversion (pull request #507)
Fixes
#928, but only by documenting restriction→ <<cset cb34b391cfc9>>
-
reporter Added readtheocs yaml file, added ref
#928to changes, though it doesn't concern this release! [skip ci] docs only→ <<cset dad07b208ceb>>
-
reporter Issue
#944was marked as a duplicate of this issue. -
reporter Issue
#944was marked as a duplicate of this issue. - Log in to comment
The syntax for “array_append” has changed in PostgreSQL 14. See this message on the PostgreSQL site:
https://www.postgresql.org/message-id/5c4ad9d6-e73a-a59c-6393-571fc69857e5%40gmx.net