﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29613	Allow --keepdb to work on PostgreSQL if the database exists but the user can't create databases	Paul McDermott	Mariusz Felisiak	"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
"	Bug	closed	Testing framework	2.0	Normal	fixed	postgres, --keepdb	Mariusz Felisiak	Ready for checkin	1	0	0	0	0	0
