Skip to content

Commit b8dd19a

Browse files
committed
Improve INSERT .. ON CONFLICT error message.
Peter Geoghegan, reviewed by me.
1 parent 869f693 commit b8dd19a

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 support deferred unique constraints/exclusion constraints as arbiters"),
538+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
539+
errmsg("ON CONFLICT does not support deferrable 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 support deferred unique constraints/exclusion constraints as arbiters
646+
ERROR: ON CONFLICT does not support deferrable 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy