diff --git a/doc/src/sgml/ref/insert.sgml b/doc/src/sgml/ref/insert.sgml index 3f139917790..b337f2ee555 100644 --- a/doc/src/sgml/ref/insert.sgml +++ b/doc/src/sgml/ref/insert.sgml @@ -594,6 +594,15 @@ INSERT INTO table_name [ AS + + + While CREATE INDEX CONCURRENTLY or REINDEX + CONCURRENTLY is running on a unique index, INSERT + ... ON CONFLICT statements on the same table may unexpectedly + fail with a unique violation. + + + diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index f4b7343dace..d950bd93002 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -789,6 +789,11 @@ find_relation_notnullatts(PlannerInfo *root, Oid relid) * the purposes of inference. If no opclass (or collation) is specified, then * all matching indexes (that may or may not match the default in terms of * each attribute opclass/collation) are used for inference. + * + * Note: during index CONCURRENTLY operations, different transactions may + * reference different sets of arbiter indexes. This can lead to false unique + * constraint violations that wouldn't occur during normal operations. For + * more information, see insert.sgml. */ List * infer_arbiter_indexes(PlannerInfo *root)