My django development projects no longer start since after a system update. Posgresql updated to version 18-beta.
Before I run pg_update on my development machine, I am curious how this may affect django projects. Has anyone in the Django community migrated? What actions should I take before running pg_upgrade? Is this uncharted territory for the community as at time of writing?
What version of PostgreSQL are you migrating from?
What error messages or logging information are you getting from your project?
./manage.py runserver
django.db.utils.OperationalError: connection failed: connection to server at “127.0.0.1”, port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
# systemctl status postgresql.service
Aug 17 16:42:49 local.machine systemd[1]: Starting postgresql.service - PostgreSQL database server…
Aug 17 16:42:49 local.machine postgresql-check-db-dir[9778]: An old version ‘16’ of the database format was found.
Aug 17 16:42:49 local.machine postgresql-check-db-dir[9778]: You need to dump and reload before using PostgreSQL 18beta1.
Aug 17 16:42:49 local.machine postgresql-check-db-dir[9778]: See /usr/share/doc/postgresql18/README.rpm-dist for more information.
Aug 17 16:42:49 local.machine systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
Aug 17 16:42:49 local.machine systemd[1]: postgresql.service: Failed with result ‘exit-code’.
Aug 17 16:42:49 local.machine systemd[1]: Failed to start postgresql.service - PostgreSQL database server.
The database is not starting.
I went ahead and installed PostgreSQL 18 beta 3 in my lab, and copied one of my projects to that machine. It runs fine, exactly like the production system it normally runs on.
(It’s a typical Django “BREAD”-style application, running in Python 3.12, Django 5.2.5, psycopg2.9.10, among other packages)
I don’t know what currently-unresolved bugs may exist in PostgreSQL 18 beta 3 - I’m not one to want to run a production system under a pre-release database version. But if you want to test in that environment, superficially it looks ok.
I would recommend using docker compose to run your development database server. That way you can control which version is used, and you can commit the configuration file to share it with other team members.