﻿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
35383	Add support for `IF NOT EXISTS` when creating postgres indexes concurrently	Marcelo		"Hi.

The code for `CREATE INDEX CONCURRENTLY` does not allow for the `IF NOT EXISTS` conditional.

This is not consistent with the pattern for other schema-change operations, which already include either `IF NOT EXISTS` or `IF EXISTS` so that changes fail without error. For example, check the DatabaseSchemaEditor queries at `django/db/backends/postgresql/schema.py`

This is particularly important in my case. I have the same Django project being deployed in different regions of the world.
I'd like to create the index concurrently out-of-business hours, which varies depending on the country. Following that, I'd like to create the migration file so that all environments are in sync.

However, if the `IF NOT EXISTS` is not available, those migrations won't be idempotent.

There is an open PR that attempts to address this:

https://github.com/django/django/pull/18081"	New feature	closed	contrib.postgres	5.0	Normal	duplicate	database, postgres, index, concurrently		Unreviewed	1	0	0	0	0	0
