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

Commitb8dd19a

Browse files
committed
Improve INSERT .. ON CONFLICT error message.
Peter Geoghegan, reviewed by me.
1 parent869f693 commitb8dd19a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎src/backend/executor/execIndexing.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@ ExecCheckIndexConstraints(TupleTableSlot *slot,
535535

536536
if (!indexRelation->rd_index->indimmediate)
537537
ereport(ERROR,
538-
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
539-
errmsg("ON CONFLICT does not supportdeferred unique constraints/exclusion constraints as arbiters"),
538+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
539+
errmsg("ON CONFLICT does not supportdeferrable unique constraints/exclusion constraints as arbiters"),
540540
errtableconstraint(heapRelation,
541541
RelationGetRelationName(indexRelation))));
542542

‎src/test/regress/output/constraints.source

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ INSERT INTO deferred_excl VALUES(1); -- fail
643643
ERROR: conflicting key value violates exclusion constraint "deferred_excl_con"
644644
DETAIL: Key (f1)=(1) conflicts with existing key (f1)=(1).
645645
INSERT INTO deferred_excl VALUES(1) ON CONFLICT ON CONSTRAINT deferred_excl_con DO NOTHING; -- fail
646-
ERROR: ON CONFLICT does not supportdeferred unique constraints/exclusion constraints as arbiters
646+
ERROR: ON CONFLICT does not supportdeferrable unique constraints/exclusion constraints as arbiters
647647
BEGIN;
648648
INSERT INTO deferred_excl VALUES(2); -- no fail here
649649
COMMIT; -- should fail here

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp