Skip to content

Commit ed6e054

Browse files
committed
Add caution about multiple unique indexes breaking plpgsql upsert example.
Per Phil Sorber, though I didn't use his wording exactly.
1 parent 17d3233 commit ed6e054

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/src/sgml/plpgsql.sgml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,10 @@ SELECT merge_db(1, 'dennis');
25612561

25622562
This coding assumes the <literal>unique_violation</> error is caused by
25632563
the <command>INSERT</>, and not by, say, an <command>INSERT</> in a
2564-
trigger function on the table. More safety could be had by using the
2564+
trigger function on the table. It might also misbehave if there is
2565+
more than one unique index on the table, since it will retry the
2566+
operation regardless of which index caused the error.
2567+
More safety could be had by using the
25652568
features discussed next to check that the trapped error was the one
25662569
expected.
25672570
</para>

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