﻿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
29717	Provide a way for tests to run on an existing empty DB	Curtis Maloney		"Periodically users ask in IRC for help running tests when the user they connect as can not create a DB.

The reasons for this situation tend to be their DBA won't allow it, or their corporate policy doesn't permit it.

Regardless, Django fails because when not using keepdb, it attempts to create the db _always_, and only catches ""duplicate DB name"" errors to indicate it already exists.

However, Postgres checks for CREATE DB permissions _before_ checking if the DB exists, so Django sees it as a generic ""DB creation problem"" and bails.

If we, instead, used the existing function [used by the keepdb logic] to test if the DB exists, we could smooth the path for users in the above situation.

I've started a patch which is currently _very_ wrong, and is awaiting feedback as requested on the django-dev mailing list.

https://github.com/django/django/pull/10349"	New feature	new	Database layer (models, ORM)	2.1	Normal			Ülgen Sarıkavak	Accepted	1	1	1	1	0	0
