Documentation Source Text

Changes On Branch mistake
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch mistake Excluding Merge-Ins

This is equivalent to a diff from 51cd7696f7 to 2458723900

2024-04-15
13:35
Version 3.43.3 (check-in: 21fbec6712 user: drh tags: branch-3.45, version-3.43.3)
2024-04-11
23:26
<s>Note that recursive_triggers=ON is required in order for triggers to work on an UPSERT.</s> Incorrect. (Closed-Leaf check-in: 2458723900 user: drh tags: mistake)
2024-04-08
14:35
Remove from lockingv3.in statements that have not been true since version 3.6.5. (check-in: 51cd7696f7 user: drh tags: branch-3.45)
14:25
Remove from lockingv3.in statements that have not been true since version 3.6.5. (check-in: 165f1390af user: dan tags: trunk)
2024-04-06
10:42
Fix typo. (check-in: 0a1c9b0dc2 user: drh tags: branch-3.45)

Changes to pages/lang_upsert.in.

146
147
148
149
150
151
152





153
154
155
156
157
158
159
of the DO UPDATE clause is always ABORT.  In other words, the behavior
is as if the DO UPDATE clause were actually written as
"DO UPDATE OR ABORT".  If the DO UPDATE clause encounters any
constraint violation, the entire INSERT statement rolls back and
halts.  This is true even if the DO UPDATE clause is
contained within an INSERT statement or a trigger that specifies some
other conflict resolution algorithm.






<h1>History</h1>

<p>UPSERT syntax was added to SQLite with version 3.24.0 ([dateof:3.24.0]).
The original implementation closely followed the PostgreSQL syntax in that
it only permitted a single ON CONFLICT clause and it required a
conflict target for on DO UPDATE.







>
>
>
>
>







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
of the DO UPDATE clause is always ABORT.  In other words, the behavior
is as if the DO UPDATE clause were actually written as
"DO UPDATE OR ABORT".  If the DO UPDATE clause encounters any
constraint violation, the entire INSERT statement rolls back and
halts.  This is true even if the DO UPDATE clause is
contained within an INSERT statement or a trigger that specifies some
other conflict resolution algorithm.

<p>UPSERT is (currently) implemented internally as a transient trigger.
Therefore, in order for the UPDATE operation of an UPSERT to fire a trigger,
you must first enable recursive triggers using the
[PRAGMA recursive_triggers=ON;] statement.

<h1>History</h1>

<p>UPSERT syntax was added to SQLite with version 3.24.0 ([dateof:3.24.0]).
The original implementation closely followed the PostgreSQL syntax in that
it only permitted a single ON CONFLICT clause and it required a
conflict target for on DO UPDATE.