#35394: Warning if 'postgres' database has been rename (e.g. DigitalOcean 
managed)
-------------------------------------+-------------------------------------
               Reporter:  Jeffry     |          Owner:  nobody
  Babb                               |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Database   |        Version:  5.0
  layer (models, ORM)                |       Keywords:  postgres default db
               Severity:  Normal     |  name
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 This warning is thrown if the 'postgres' database does not exist on the
 server.  DigitalOcean renames this database to 'defaultdb' which seems to
 raise this error in dango/db/backends/base/base.py


 {{{
         except (Database.DatabaseError, WrappedDatabaseError):
             if cursor is not None:
                 raise
             warnings.warn(
                 "Normally Django will use a connection to the 'postgres'
 database "
                 "to avoid running initialization queries against the
 production "
                 "database when it's not needed (for example, when running
 tests). "
                 "Django was unable to create a connection to the
 'postgres' database "
                 "and will use the first PostgreSQL database instead.",
                 RuntimeWarning,
             )
 }}}

 I have searched in the LIBPQ parameters can can't find a setting that
 allows me to specify this name change as Django seems to have hard-coded
 the search for the 'postgres' db name or is looking for it in a key called
 'service' around line 193 and 218 in base.py.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35394>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f03c3dc97-92512da5-2ad9-4bd5-ab3c-78f67fab9568-000000%40eu-central-1.amazonses.com.

Reply via email to