#29613: --keepdb flag for postgresql does not work with some database error codes -------------------------------------+------------------------------------- Reporter: Paul | Owner: nobody McDermott | Type: Bug | Status: new Component: Database | Version: 2.0 layer (models, ORM) | Severity: Normal | Keywords: postgres, --keepdb Triage Stage: | Has patch: 0 Unreviewed | Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------+------------------------------------- The popular Web Faction hosting service uses a shared database server. Users can create databases using the web UI or XML RPC calls, but not using the SQL CREATE syntax.
Running tests throws a ProgrammingError, with the message 'permission denied to create database', even if the test database has been previously created manually. The error code for this error is '42501', which appears to correspond to errorcodes.INSUFFICIENT_PRIVILEGE. django/db/backends/postgresql/creation.py only handles the error errorcodes.DUPLICATE_DATABASE in _execute_create_test_db(), line 35. Because the error code does not match the program exits with a log message. But it would be fine to proceed with the error code '42501' also, making use of the --keepdb mechanism. This appears to be a regression, as I did not experience this issue either using postgresql_psycopg2 driver or using Django 1.11 -- Ticket URL: <https://code.djangoproject.com/ticket/29613> 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 post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/054.7e8faa3d630bb0dd53eac30cb34b9df7%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.