Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfaba259

Browse files
committed
Doc: cover index CONCURRENTLY causing errors in INSERT ... ON CONFLICT.
Author: Mikhail Nikalayeu <mihailnikalayeu@gmail.com>Reviewed-by: Noah Misch <noah@leadboat.com>Discussion:https://postgr.es/m/CANtu0ojXmqjmEzp-=aJSxjsdE76iAsRgHBoK0QtYHimb_mEfsg@mail.gmail.comBackpatch-through: 13
1 parentd26997c commitfaba259

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎doc/src/sgml/ref/insert.sgml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,15 @@ INSERT INTO <replaceable class="parameter">table_name</replaceable> [ AS <replac
556556
</para>
557557
</tip>
558558

559+
<warning>
560+
<para>
561+
While <command>CREATE INDEX CONCURRENTLY</command> or <command>REINDEX
562+
CONCURRENTLY</command> is running on a unique index, <command>INSERT
563+
... ON CONFLICT</command> statements on the same table may unexpectedly
564+
fail with a unique violation.
565+
</para>
566+
</warning>
567+
559568
</refsect2>
560569
</refsect1>
561570

‎src/backend/optimizer/util/plancat.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ get_relation_foreign_keys(PlannerInfo *root, RelOptInfo *rel,
634634
* the purposes of inference. If no opclass (or collation) is specified, then
635635
* all matching indexes (that may or may not match the default in terms of
636636
* each attribute opclass/collation) are used for inference.
637+
*
638+
* Note: during index CONCURRENTLY operations, different transactions may
639+
* reference different sets of arbiter indexes. This can lead to false unique
640+
* constraint violations that wouldn't occur during normal operations. For
641+
* more information, see insert.sgml.
637642
*/
638643
List*
639644
infer_arbiter_indexes(PlannerInfo*root)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp