#35394: Warning if `postgres` database has been renamed (e.g. DigitalOcean managed) -------------------------------------+------------------------------------- Reporter: Jeffry Babb | Owner: nobody Type: | Status: closed Cleanup/optimization | Component: Database layer | Version: 5.0 (models, ORM) | Severity: Normal | Resolution: needsinfo Keywords: postgres default db | Triage Stage: name | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Tim Graham):
* summary: Warning if `postgres` database has been rename (e.g. DigitalOcean managed) => Warning if `postgres` database has been renamed (e.g. DigitalOcean managed) Comment: The postgres database being named differently on Heroku was the impetus for adding the fallback and the warning (#24791). Making the name of the defaultdb configurable was [https://groups.google.com/g/django- developers/c/ymdT05CaPF0/m/Vov9hzMOrvYJ proposed as a possible solution] but there weren't any arguments for or against. The fallback solution makes things easy for the user, although the warning is mildly annoying and hardcoding 'postgres' leaves no way to configure things safely. [https://github.com/django/django/blob/bcad5ad92b1dad2874453dee7a480e9b9f29aad5/django/db/backends/base/base.py#L708 The docstring] of`BaseDatabaseWrapper._nodb_cursor()` explains possible dangers of the current fallback approach. I can't think of a better way to make this configurable than to add a new option in `DATABASES` like `DEFAULT_DB`, although it appears only applicable on PostgreSQL. I'm not sure if it's worth it. I would continue the discussion on the mailing list. -- Ticket URL: <https://code.djangoproject.com/ticket/35394#comment:3> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107018f08cca826-0e924b88-aea5-4bb0-af3f-bccc8460da23-000000%40eu-central-1.amazonses.com.