Debian Codegraph @

src/test/isolation/expected/eval-plan-qual.out

raw
1 Parsed test spec with 3 sessions
2
3 starting permutation: wx1 wx2 c1 c2 read
4 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
5 balance
6 -------
7 400
8 (1 row)
9
10 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance; <waiting ...>
11 step c1: COMMIT;
12 step wx2: <... completed>
13 balance
14 -------
15 850
16 (1 row)
17
18 step c2: COMMIT;
19 step read: SELECT * FROM accounts ORDER BY accountid;
20 accountid|balance|balance2
21 ---------+-------+--------
22 checking | 850| 1700
23 savings | 600| 1200
24 (2 rows)
25
26
27 starting permutation: wy1 wy2 c1 c2 read
28 step wy1: UPDATE accounts SET balance = balance + 500 WHERE accountid = 'checking' RETURNING balance;
29 balance
30 -------
31 1100
32 (1 row)
33
34 step wy2: UPDATE accounts SET balance = balance + 1000 WHERE accountid = 'checking' AND balance < 1000 RETURNING balance; <waiting ...>
35 step c1: COMMIT;
36 step wy2: <... completed>
37 balance
38 -------
39 (0 rows)
40
41 step c2: COMMIT;
42 step read: SELECT * FROM accounts ORDER BY accountid;
43 accountid|balance|balance2
44 ---------+-------+--------
45 checking | 1100| 2200
46 savings | 600| 1200
47 (2 rows)
48
49
50 starting permutation: wx1 wx2 r1 c2 read
51 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
52 balance
53 -------
54 400
55 (1 row)
56
57 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance; <waiting ...>
58 step r1: ROLLBACK;
59 step wx2: <... completed>
60 balance
61 -------
62 1050
63 (1 row)
64
65 step c2: COMMIT;
66 step read: SELECT * FROM accounts ORDER BY accountid;
67 accountid|balance|balance2
68 ---------+-------+--------
69 checking | 1050| 2100
70 savings | 600| 1200
71 (2 rows)
72
73
74 starting permutation: wy1 wy2 r1 c2 read
75 step wy1: UPDATE accounts SET balance = balance + 500 WHERE accountid = 'checking' RETURNING balance;
76 balance
77 -------
78 1100
79 (1 row)
80
81 step wy2: UPDATE accounts SET balance = balance + 1000 WHERE accountid = 'checking' AND balance < 1000 RETURNING balance; <waiting ...>
82 step r1: ROLLBACK;
83 step wy2: <... completed>
84 balance
85 -------
86 1600
87 (1 row)
88
89 step c2: COMMIT;
90 step read: SELECT * FROM accounts ORDER BY accountid;
91 accountid|balance|balance2
92 ---------+-------+--------
93 checking | 1600| 3200
94 savings | 600| 1200
95 (2 rows)
96
97
98 starting permutation: wx1 d1 wx2 c1 c2 read
99 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
100 balance
101 -------
102 400
103 (1 row)
104
105 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance;
106 balance
107 -------
108 400
109 (1 row)
110
111 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance; <waiting ...>
112 step c1: COMMIT;
113 step wx2: <... completed>
114 balance
115 -------
116 (0 rows)
117
118 step c2: COMMIT;
119 step read: SELECT * FROM accounts ORDER BY accountid;
120 accountid|balance|balance2
121 ---------+-------+--------
122 savings | 600| 1200
123 (1 row)
124
125
126 starting permutation: wx2 d1 c2 c1 read
127 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
128 balance
129 -------
130 1050
131 (1 row)
132
133 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance; <waiting ...>
134 step c2: COMMIT;
135 step d1: <... completed>
136 balance
137 -------
138 1050
139 (1 row)
140
141 step c1: COMMIT;
142 step read: SELECT * FROM accounts ORDER BY accountid;
143 accountid|balance|balance2
144 ---------+-------+--------
145 savings | 600| 1200
146 (1 row)
147
148
149 starting permutation: wx2 wx2 d1 c2 c1 read
150 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
151 balance
152 -------
153 1050
154 (1 row)
155
156 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
157 balance
158 -------
159 1500
160 (1 row)
161
162 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance; <waiting ...>
163 step c2: COMMIT;
164 step d1: <... completed>
165 balance
166 -------
167 (0 rows)
168
169 step c1: COMMIT;
170 step read: SELECT * FROM accounts ORDER BY accountid;
171 accountid|balance|balance2
172 ---------+-------+--------
173 checking | 1500| 3000
174 savings | 600| 1200
175 (2 rows)
176
177
178 starting permutation: wx2 d2 d1 c2 c1 read
179 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
180 balance
181 -------
182 1050
183 (1 row)
184
185 step d2: DELETE FROM accounts WHERE accountid = 'checking';
186 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance; <waiting ...>
187 step c2: COMMIT;
188 step d1: <... completed>
189 balance
190 -------
191 (0 rows)
192
193 step c1: COMMIT;
194 step read: SELECT * FROM accounts ORDER BY accountid;
195 accountid|balance|balance2
196 ---------+-------+--------
197 savings | 600| 1200
198 (1 row)
199
200
201 starting permutation: wx1 d1 wx2 r1 c2 read
202 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
203 balance
204 -------
205 400
206 (1 row)
207
208 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance;
209 balance
210 -------
211 400
212 (1 row)
213
214 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance; <waiting ...>
215 step r1: ROLLBACK;
216 step wx2: <... completed>
217 balance
218 -------
219 1050
220 (1 row)
221
222 step c2: COMMIT;
223 step read: SELECT * FROM accounts ORDER BY accountid;
224 accountid|balance|balance2
225 ---------+-------+--------
226 checking | 1050| 2100
227 savings | 600| 1200
228 (2 rows)
229
230
231 starting permutation: wx2 d1 r2 c1 read
232 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
233 balance
234 -------
235 1050
236 (1 row)
237
238 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance; <waiting ...>
239 step r2: ROLLBACK;
240 step d1: <... completed>
241 balance
242 -------
243 600
244 (1 row)
245
246 step c1: COMMIT;
247 step read: SELECT * FROM accounts ORDER BY accountid;
248 accountid|balance|balance2
249 ---------+-------+--------
250 savings | 600| 1200
251 (1 row)
252
253
254 starting permutation: wx2 wx2 d1 r2 c1 read
255 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
256 balance
257 -------
258 1050
259 (1 row)
260
261 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
262 balance
263 -------
264 1500
265 (1 row)
266
267 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance; <waiting ...>
268 step r2: ROLLBACK;
269 step d1: <... completed>
270 balance
271 -------
272 600
273 (1 row)
274
275 step c1: COMMIT;
276 step read: SELECT * FROM accounts ORDER BY accountid;
277 accountid|balance|balance2
278 ---------+-------+--------
279 savings | 600| 1200
280 (1 row)
281
282
283 starting permutation: wx2 d2 d1 r2 c1 read
284 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
285 balance
286 -------
287 1050
288 (1 row)
289
290 step d2: DELETE FROM accounts WHERE accountid = 'checking';
291 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance; <waiting ...>
292 step r2: ROLLBACK;
293 step d1: <... completed>
294 balance
295 -------
296 600
297 (1 row)
298
299 step c1: COMMIT;
300 step read: SELECT * FROM accounts ORDER BY accountid;
301 accountid|balance|balance2
302 ---------+-------+--------
303 savings | 600| 1200
304 (1 row)
305
306
307 starting permutation: d1 wx2 c1 c2 read
308 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance;
309 balance
310 -------
311 600
312 (1 row)
313
314 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance; <waiting ...>
315 step c1: COMMIT;
316 step wx2: <... completed>
317 balance
318 -------
319 (0 rows)
320
321 step c2: COMMIT;
322 step read: SELECT * FROM accounts ORDER BY accountid;
323 accountid|balance|balance2
324 ---------+-------+--------
325 savings | 600| 1200
326 (1 row)
327
328
329 starting permutation: d1 wx2 r1 c2 read
330 step d1: DELETE FROM accounts WHERE accountid = 'checking' AND balance < 1500 RETURNING balance;
331 balance
332 -------
333 600
334 (1 row)
335
336 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance; <waiting ...>
337 step r1: ROLLBACK;
338 step wx2: <... completed>
339 balance
340 -------
341 1050
342 (1 row)
343
344 step c2: COMMIT;
345 step read: SELECT * FROM accounts ORDER BY accountid;
346 accountid|balance|balance2
347 ---------+-------+--------
348 checking | 1050| 2100
349 savings | 600| 1200
350 (2 rows)
351
352
353 starting permutation: wnested2 c1 c2 read
354 s2: NOTICE: upid: text checking = text checking: t
355 s2: NOTICE: up: numeric 600 > numeric 200.0: t
356 s2: NOTICE: lock_id: text checking = text checking: t
357 s2: NOTICE: lock_bal: numeric 600 > numeric 200.0: t
358 s2: NOTICE: upid: text savings = text checking: f
359 step wnested2:
360 UPDATE accounts SET balance = balance - 1200
361 WHERE noisy_oper('upid', accountid, '=', 'checking')
362 AND noisy_oper('up', balance, '>', 200.0)
363 AND EXISTS (
364 SELECT accountid
365 FROM accounts_ext ae
366 WHERE noisy_oper('lock_id', ae.accountid, '=', accounts.accountid)
367 AND noisy_oper('lock_bal', ae.balance, '>', 200.0)
368 FOR UPDATE
369 );
370
371 step c1: COMMIT;
372 step c2: COMMIT;
373 step read: SELECT * FROM accounts ORDER BY accountid;
374 accountid|balance|balance2
375 ---------+-------+--------
376 checking | -600| -1200
377 savings | 600| 1200
378 (2 rows)
379
380
381 starting permutation: wx1 wxext1 wnested2 c1 c2 read
382 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
383 balance
384 -------
385 400
386 (1 row)
387
388 step wxext1: UPDATE accounts_ext SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
389 balance
390 -------
391 400
392 (1 row)
393
394 s2: NOTICE: upid: text checking = text checking: t
395 s2: NOTICE: up: numeric 600 > numeric 200.0: t
396 s2: NOTICE: lock_id: text checking = text checking: t
397 s2: NOTICE: lock_bal: numeric 600 > numeric 200.0: t
398 step wnested2:
399 UPDATE accounts SET balance = balance - 1200
400 WHERE noisy_oper('upid', accountid, '=', 'checking')
401 AND noisy_oper('up', balance, '>', 200.0)
402 AND EXISTS (
403 SELECT accountid
404 FROM accounts_ext ae
405 WHERE noisy_oper('lock_id', ae.accountid, '=', accounts.accountid)
406 AND noisy_oper('lock_bal', ae.balance, '>', 200.0)
407 FOR UPDATE
408 );
409 <waiting ...>
410 step c1: COMMIT;
411 s2: NOTICE: lock_id: text checking = text checking: t
412 s2: NOTICE: lock_bal: numeric 400 > numeric 200.0: t
413 s2: NOTICE: upid: text checking = text checking: t
414 s2: NOTICE: up: numeric 400 > numeric 200.0: t
415 s2: NOTICE: lock_id: text checking = text checking: t
416 s2: NOTICE: lock_bal: numeric 600 > numeric 200.0: t
417 s2: NOTICE: lock_id: text checking = text checking: t
418 s2: NOTICE: lock_bal: numeric 400 > numeric 200.0: t
419 s2: NOTICE: upid: text savings = text checking: f
420 step wnested2: <... completed>
421 step c2: COMMIT;
422 step read: SELECT * FROM accounts ORDER BY accountid;
423 accountid|balance|balance2
424 ---------+-------+--------
425 checking | -800| -1600
426 savings | 600| 1200
427 (2 rows)
428
429
430 starting permutation: wx1 wx1 wxext1 wnested2 c1 c2 read
431 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
432 balance
433 -------
434 400
435 (1 row)
436
437 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
438 balance
439 -------
440 200
441 (1 row)
442
443 step wxext1: UPDATE accounts_ext SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
444 balance
445 -------
446 400
447 (1 row)
448
449 s2: NOTICE: upid: text checking = text checking: t
450 s2: NOTICE: up: numeric 600 > numeric 200.0: t
451 s2: NOTICE: lock_id: text checking = text checking: t
452 s2: NOTICE: lock_bal: numeric 600 > numeric 200.0: t
453 step wnested2:
454 UPDATE accounts SET balance = balance - 1200
455 WHERE noisy_oper('upid', accountid, '=', 'checking')
456 AND noisy_oper('up', balance, '>', 200.0)
457 AND EXISTS (
458 SELECT accountid
459 FROM accounts_ext ae
460 WHERE noisy_oper('lock_id', ae.accountid, '=', accounts.accountid)
461 AND noisy_oper('lock_bal', ae.balance, '>', 200.0)
462 FOR UPDATE
463 );
464 <waiting ...>
465 step c1: COMMIT;
466 s2: NOTICE: lock_id: text checking = text checking: t
467 s2: NOTICE: lock_bal: numeric 400 > numeric 200.0: t
468 s2: NOTICE: upid: text checking = text checking: t
469 s2: NOTICE: up: numeric 200 > numeric 200.0: f
470 s2: NOTICE: upid: text savings = text checking: f
471 step wnested2: <... completed>
472 step c2: COMMIT;
473 step read: SELECT * FROM accounts ORDER BY accountid;
474 accountid|balance|balance2
475 ---------+-------+--------
476 checking | 200| 400
477 savings | 600| 1200
478 (2 rows)
479
480
481 starting permutation: wx1 wx1 wxext1 wxext1 wnested2 c1 c2 read
482 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
483 balance
484 -------
485 400
486 (1 row)
487
488 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
489 balance
490 -------
491 200
492 (1 row)
493
494 step wxext1: UPDATE accounts_ext SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
495 balance
496 -------
497 400
498 (1 row)
499
500 step wxext1: UPDATE accounts_ext SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
501 balance
502 -------
503 200
504 (1 row)
505
506 s2: NOTICE: upid: text checking = text checking: t
507 s2: NOTICE: up: numeric 600 > numeric 200.0: t
508 s2: NOTICE: lock_id: text checking = text checking: t
509 s2: NOTICE: lock_bal: numeric 600 > numeric 200.0: t
510 step wnested2:
511 UPDATE accounts SET balance = balance - 1200
512 WHERE noisy_oper('upid', accountid, '=', 'checking')
513 AND noisy_oper('up', balance, '>', 200.0)
514 AND EXISTS (
515 SELECT accountid
516 FROM accounts_ext ae
517 WHERE noisy_oper('lock_id', ae.accountid, '=', accounts.accountid)
518 AND noisy_oper('lock_bal', ae.balance, '>', 200.0)
519 FOR UPDATE
520 );
521 <waiting ...>
522 step c1: COMMIT;
523 s2: NOTICE: lock_id: text checking = text checking: t
524 s2: NOTICE: lock_bal: numeric 200 > numeric 200.0: f
525 s2: NOTICE: lock_id: text savings = text checking: f
526 s2: NOTICE: upid: text savings = text checking: f
527 step wnested2: <... completed>
528 step c2: COMMIT;
529 step read: SELECT * FROM accounts ORDER BY accountid;
530 accountid|balance|balance2
531 ---------+-------+--------
532 checking | 200| 400
533 savings | 600| 1200
534 (2 rows)
535
536
537 starting permutation: wx1 wxext1 wxext1 wnested2 c1 c2 read
538 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
539 balance
540 -------
541 400
542 (1 row)
543
544 step wxext1: UPDATE accounts_ext SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
545 balance
546 -------
547 400
548 (1 row)
549
550 step wxext1: UPDATE accounts_ext SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
551 balance
552 -------
553 200
554 (1 row)
555
556 s2: NOTICE: upid: text checking = text checking: t
557 s2: NOTICE: up: numeric 600 > numeric 200.0: t
558 s2: NOTICE: lock_id: text checking = text checking: t
559 s2: NOTICE: lock_bal: numeric 600 > numeric 200.0: t
560 step wnested2:
561 UPDATE accounts SET balance = balance - 1200
562 WHERE noisy_oper('upid', accountid, '=', 'checking')
563 AND noisy_oper('up', balance, '>', 200.0)
564 AND EXISTS (
565 SELECT accountid
566 FROM accounts_ext ae
567 WHERE noisy_oper('lock_id', ae.accountid, '=', accounts.accountid)
568 AND noisy_oper('lock_bal', ae.balance, '>', 200.0)
569 FOR UPDATE
570 );
571 <waiting ...>
572 step c1: COMMIT;
573 s2: NOTICE: lock_id: text checking = text checking: t
574 s2: NOTICE: lock_bal: numeric 200 > numeric 200.0: f
575 s2: NOTICE: lock_id: text savings = text checking: f
576 s2: NOTICE: upid: text savings = text checking: f
577 step wnested2: <... completed>
578 step c2: COMMIT;
579 step read: SELECT * FROM accounts ORDER BY accountid;
580 accountid|balance|balance2
581 ---------+-------+--------
582 checking | 400| 800
583 savings | 600| 1200
584 (2 rows)
585
586
587 starting permutation: wx1 tocds1 wnested2 c1 c2 read
588 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
589 balance
590 -------
591 400
592 (1 row)
593
594 step tocds1: UPDATE accounts SET accountid = 'cds' WHERE accountid = 'checking';
595 s2: NOTICE: upid: text checking = text checking: t
596 s2: NOTICE: up: numeric 600 > numeric 200.0: t
597 s2: NOTICE: lock_id: text checking = text checking: t
598 s2: NOTICE: lock_bal: numeric 600 > numeric 200.0: t
599 step wnested2:
600 UPDATE accounts SET balance = balance - 1200
601 WHERE noisy_oper('upid', accountid, '=', 'checking')
602 AND noisy_oper('up', balance, '>', 200.0)
603 AND EXISTS (
604 SELECT accountid
605 FROM accounts_ext ae
606 WHERE noisy_oper('lock_id', ae.accountid, '=', accounts.accountid)
607 AND noisy_oper('lock_bal', ae.balance, '>', 200.0)
608 FOR UPDATE
609 );
610 <waiting ...>
611 step c1: COMMIT;
612 s2: NOTICE: upid: text cds = text checking: f
613 s2: NOTICE: upid: text savings = text checking: f
614 step wnested2: <... completed>
615 step c2: COMMIT;
616 step read: SELECT * FROM accounts ORDER BY accountid;
617 accountid|balance|balance2
618 ---------+-------+--------
619 cds | 400| 800
620 savings | 600| 1200
621 (2 rows)
622
623
624 starting permutation: wx1 tocdsext1 wnested2 c1 c2 read
625 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
626 balance
627 -------
628 400
629 (1 row)
630
631 step tocdsext1: UPDATE accounts_ext SET accountid = 'cds' WHERE accountid = 'checking';
632 s2: NOTICE: upid: text checking = text checking: t
633 s2: NOTICE: up: numeric 600 > numeric 200.0: t
634 s2: NOTICE: lock_id: text checking = text checking: t
635 s2: NOTICE: lock_bal: numeric 600 > numeric 200.0: t
636 step wnested2:
637 UPDATE accounts SET balance = balance - 1200
638 WHERE noisy_oper('upid', accountid, '=', 'checking')
639 AND noisy_oper('up', balance, '>', 200.0)
640 AND EXISTS (
641 SELECT accountid
642 FROM accounts_ext ae
643 WHERE noisy_oper('lock_id', ae.accountid, '=', accounts.accountid)
644 AND noisy_oper('lock_bal', ae.balance, '>', 200.0)
645 FOR UPDATE
646 );
647 <waiting ...>
648 step c1: COMMIT;
649 s2: NOTICE: lock_id: text cds = text checking: f
650 s2: NOTICE: lock_id: text savings = text checking: f
651 s2: NOTICE: upid: text savings = text checking: f
652 step wnested2: <... completed>
653 step c2: COMMIT;
654 step read: SELECT * FROM accounts ORDER BY accountid;
655 accountid|balance|balance2
656 ---------+-------+--------
657 checking | 400| 800
658 savings | 600| 1200
659 (2 rows)
660
661
662 starting permutation: wx1 updwcte c1 c2 read
663 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
664 balance
665 -------
666 400
667 (1 row)
668
669 step updwcte: WITH doup AS (UPDATE accounts SET balance = balance + 1100 WHERE accountid = 'checking' RETURNING *) UPDATE accounts a SET balance = doup.balance + 100 FROM doup RETURNING *; <waiting ...>
670 step c1: COMMIT;
671 step updwcte: <... completed>
672 accountid|balance|balance2|accountid|balance|balance2
673 ---------+-------+--------+---------+-------+--------
674 savings | 1600| 3200|checking | 1500| 3000
675 (1 row)
676
677 step c2: COMMIT;
678 step read: SELECT * FROM accounts ORDER BY accountid;
679 accountid|balance|balance2
680 ---------+-------+--------
681 checking | 1500| 3000
682 savings | 1600| 3200
683 (2 rows)
684
685
686 starting permutation: wx1 updwctefail c1 c2 read
687 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
688 balance
689 -------
690 400
691 (1 row)
692
693 step updwctefail: WITH doup AS (UPDATE accounts SET balance = balance + 1100 WHERE accountid = 'checking' RETURNING *, update_checking(999)) UPDATE accounts a SET balance = doup.balance + 100 FROM doup RETURNING *; <waiting ...>
694 step c1: COMMIT;
695 step updwctefail: <... completed>
696 ERROR: tuple to be updated was already modified by an operation triggered by the current command
697 step c2: COMMIT;
698 step read: SELECT * FROM accounts ORDER BY accountid;
699 accountid|balance|balance2
700 ---------+-------+--------
701 checking | 400| 800
702 savings | 600| 1200
703 (2 rows)
704
705
706 starting permutation: wx1 delwcte c1 c2 read
707 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
708 balance
709 -------
710 400
711 (1 row)
712
713 step delwcte: WITH doup AS (UPDATE accounts SET balance = balance + 1100 WHERE accountid = 'checking' RETURNING *) DELETE FROM accounts a USING doup RETURNING *; <waiting ...>
714 step c1: COMMIT;
715 step delwcte: <... completed>
716 accountid|balance|balance2|accountid|balance|balance2
717 ---------+-------+--------+---------+-------+--------
718 savings | 600| 1200|checking | 1500| 3000
719 (1 row)
720
721 step c2: COMMIT;
722 step read: SELECT * FROM accounts ORDER BY accountid;
723 accountid|balance|balance2
724 ---------+-------+--------
725 checking | 1500| 3000
726 (1 row)
727
728
729 starting permutation: wx1 delwctefail c1 c2 read
730 step wx1: UPDATE accounts SET balance = balance - 200 WHERE accountid = 'checking' RETURNING balance;
731 balance
732 -------
733 400
734 (1 row)
735
736 step delwctefail: WITH doup AS (UPDATE accounts SET balance = balance + 1100 WHERE accountid = 'checking' RETURNING *, update_checking(999)) DELETE FROM accounts a USING doup RETURNING *; <waiting ...>
737 step c1: COMMIT;
738 step delwctefail: <... completed>
739 ERROR: tuple to be deleted was already modified by an operation triggered by the current command
740 step c2: COMMIT;
741 step read: SELECT * FROM accounts ORDER BY accountid;
742 accountid|balance|balance2
743 ---------+-------+--------
744 checking | 400| 800
745 savings | 600| 1200
746 (2 rows)
747
748
749 starting permutation: read wx2 wb1 c2 c1 read
750 step read: SELECT * FROM accounts ORDER BY accountid;
751 accountid|balance|balance2
752 ---------+-------+--------
753 checking | 600| 1200
754 savings | 600| 1200
755 (2 rows)
756
757 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
758 balance
759 -------
760 1050
761 (1 row)
762
763 step wb1: DELETE FROM accounts WHERE balance = 600 RETURNING *; <waiting ...>
764 step c2: COMMIT;
765 step wb1: <... completed>
766 accountid|balance|balance2
767 ---------+-------+--------
768 savings | 600| 1200
769 (1 row)
770
771 step c1: COMMIT;
772 step read: SELECT * FROM accounts ORDER BY accountid;
773 accountid|balance|balance2
774 ---------+-------+--------
775 checking | 1050| 2100
776 (1 row)
777
778
779 starting permutation: upsert1 upsert2 c1 c2 read
780 step upsert1:
781 WITH upsert AS
782 (UPDATE accounts SET balance = balance + 500
783 WHERE accountid = 'savings'
784 RETURNING accountid)
785 INSERT INTO accounts SELECT 'savings', 500
786 WHERE NOT EXISTS (SELECT 1 FROM upsert);
787
788 step upsert2:
789 WITH upsert AS
790 (UPDATE accounts SET balance = balance + 1234
791 WHERE accountid = 'savings'
792 RETURNING accountid)
793 INSERT INTO accounts SELECT 'savings', 1234
794 WHERE NOT EXISTS (SELECT 1 FROM upsert);
795 <waiting ...>
796 step c1: COMMIT;
797 step upsert2: <... completed>
798 step c2: COMMIT;
799 step read: SELECT * FROM accounts ORDER BY accountid;
800 accountid|balance|balance2
801 ---------+-------+--------
802 checking | 600| 1200
803 savings | 2334| 4668
804 (2 rows)
805
806
807 starting permutation: readp1 writep1 readp2 c1 c2
808 step readp1: SELECT tableoid::regclass, ctid, * FROM p WHERE b IN (0, 1) AND c = 0 FOR UPDATE;
809 tableoid|ctid |a|b|c
810 --------+-----+-+-+-
811 c1 |(0,1)|0|0|0
812 c1 |(0,4)|0|1|0
813 c2 |(0,1)|1|0|0
814 c2 |(0,4)|1|1|0
815 c3 |(0,1)|2|0|0
816 c3 |(0,4)|2|1|0
817 (6 rows)
818
819 step writep1: UPDATE p SET b = -1 WHERE a = 1 AND b = 1 AND c = 0;
820 step readp2: SELECT tableoid::regclass, ctid, * FROM p WHERE b IN (0, 1) AND c = 0 FOR UPDATE; <waiting ...>
821 step c1: COMMIT;
822 step readp2: <... completed>
823 tableoid|ctid |a|b|c
824 --------+-----+-+-+-
825 c1 |(0,1)|0|0|0
826 c1 |(0,4)|0|1|0
827 c2 |(0,1)|1|0|0
828 c3 |(0,1)|2|0|0
829 c3 |(0,4)|2|1|0
830 (5 rows)
831
832 step c2: COMMIT;
833
834 starting permutation: writep2 returningp1 c1 c2
835 step writep2: UPDATE p SET b = -b WHERE a = 1 AND c = 0;
836 step returningp1:
837 WITH u AS ( UPDATE p SET b = b WHERE a > 0 RETURNING * )
838 SELECT * FROM u;
839 <waiting ...>
840 step c1: COMMIT;
841 step returningp1: <... completed>
842 a| b|c
843 -+--+-
844 1| 0|0
845 1| 0|1
846 1| 0|2
847 1|-1|0
848 1| 1|1
849 1| 1|2
850 1|-2|0
851 1| 2|1
852 1| 2|2
853 1|-3|0
854 2| 0|0
855 2| 0|1
856 2| 0|2
857 2| 1|0
858 2| 1|1
859 2| 1|2
860 2| 2|0
861 2| 2|1
862 2| 2|2
863 2| 3|0
864 (20 rows)
865
866 step c2: COMMIT;
867
868 starting permutation: writep3a writep3b c1 c2
869 step writep3a: UPDATE p SET b = -b WHERE c = 0;
870 step writep3b: UPDATE p SET b = -b WHERE c = 0; <waiting ...>
871 step c1: COMMIT;
872 step writep3b: <... completed>
873 step c2: COMMIT;
874
875 starting permutation: writep4a writep4b c1 c2 readp
876 step writep4a: UPDATE p SET c = 4 WHERE c = 0;
877 step writep4b: UPDATE p SET b = -4 WHERE c = 0; <waiting ...>
878 step c1: COMMIT;
879 step writep4b: <... completed>
880 step c2: COMMIT;
881 step readp: SELECT tableoid::regclass, ctid, * FROM p;
882 tableoid|ctid |a|b|c
883 --------+------+-+-+-
884 c1 |(0,2) |0|0|1
885 c1 |(0,3) |0|0|2
886 c1 |(0,5) |0|1|1
887 c1 |(0,6) |0|1|2
888 c1 |(0,8) |0|2|1
889 c1 |(0,9) |0|2|2
890 c1 |(0,11)|0|0|4
891 c1 |(0,12)|0|1|4
892 c1 |(0,13)|0|2|4
893 c1 |(0,14)|0|3|4
894 c2 |(0,2) |1|0|1
895 c2 |(0,3) |1|0|2
896 c2 |(0,5) |1|1|1
897 c2 |(0,6) |1|1|2
898 c2 |(0,8) |1|2|1
899 c2 |(0,9) |1|2|2
900 c2 |(0,11)|1|0|4
901 c2 |(0,12)|1|1|4
902 c2 |(0,13)|1|2|4
903 c2 |(0,14)|1|3|4
904 c3 |(0,2) |2|0|1
905 c3 |(0,3) |2|0|2
906 c3 |(0,5) |2|1|1
907 c3 |(0,6) |2|1|2
908 c3 |(0,8) |2|2|1
909 c3 |(0,9) |2|2|2
910 c3 |(0,11)|2|0|4
911 c3 |(0,12)|2|1|4
912 c3 |(0,13)|2|2|4
913 c3 |(0,14)|2|3|4
914 (30 rows)
915
916
917 starting permutation: writep4a deletep4 c1 c2 readp
918 step writep4a: UPDATE p SET c = 4 WHERE c = 0;
919 step deletep4: DELETE FROM p WHERE c = 0; <waiting ...>
920 step c1: COMMIT;
921 step deletep4: <... completed>
922 step c2: COMMIT;
923 step readp: SELECT tableoid::regclass, ctid, * FROM p;
924 tableoid|ctid |a|b|c
925 --------+------+-+-+-
926 c1 |(0,2) |0|0|1
927 c1 |(0,3) |0|0|2
928 c1 |(0,5) |0|1|1
929 c1 |(0,6) |0|1|2
930 c1 |(0,8) |0|2|1
931 c1 |(0,9) |0|2|2
932 c1 |(0,11)|0|0|4
933 c1 |(0,12)|0|1|4
934 c1 |(0,13)|0|2|4
935 c1 |(0,14)|0|3|4
936 c2 |(0,2) |1|0|1
937 c2 |(0,3) |1|0|2
938 c2 |(0,5) |1|1|1
939 c2 |(0,6) |1|1|2
940 c2 |(0,8) |1|2|1
941 c2 |(0,9) |1|2|2
942 c2 |(0,11)|1|0|4
943 c2 |(0,12)|1|1|4
944 c2 |(0,13)|1|2|4
945 c2 |(0,14)|1|3|4
946 c3 |(0,2) |2|0|1
947 c3 |(0,3) |2|0|2
948 c3 |(0,5) |2|1|1
949 c3 |(0,6) |2|1|2
950 c3 |(0,8) |2|2|1
951 c3 |(0,9) |2|2|2
952 c3 |(0,11)|2|0|4
953 c3 |(0,12)|2|1|4
954 c3 |(0,13)|2|2|4
955 c3 |(0,14)|2|3|4
956 (30 rows)
957
958
959 starting permutation: wx2 partiallock c2 c1 read
960 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
961 balance
962 -------
963 1050
964 (1 row)
965
966 step partiallock:
967 SELECT * FROM accounts a1, accounts a2
968 WHERE a1.accountid = a2.accountid
969 FOR UPDATE OF a1;
970 <waiting ...>
971 step c2: COMMIT;
972 step partiallock: <... completed>
973 accountid|balance|balance2|accountid|balance|balance2
974 ---------+-------+--------+---------+-------+--------
975 checking | 1050| 2100|checking | 600| 1200
976 savings | 600| 1200|savings | 600| 1200
977 (2 rows)
978
979 step c1: COMMIT;
980 step read: SELECT * FROM accounts ORDER BY accountid;
981 accountid|balance|balance2
982 ---------+-------+--------
983 checking | 1050| 2100
984 savings | 600| 1200
985 (2 rows)
986
987
988 starting permutation: wx2 lockwithvalues c2 c1 read
989 step wx2: UPDATE accounts SET balance = balance + 450 WHERE accountid = 'checking' RETURNING balance;
990 balance
991 -------
992 1050
993 (1 row)
994
995 step lockwithvalues:
996 -- Reference rowmark column that differs in type from targetlist at some attno.
997 -- See CAHU7rYZo_C4ULsAx_LAj8az9zqgrD8WDd4hTegDTMM1LMqrBsg@mail.gmail.com
998 SELECT a1.*, v.id FROM accounts a1, (values('checking'::text, 'nan'::text),('savings', 'nan')) v(id, notnumeric)
999 WHERE a1.accountid = v.id AND v.notnumeric != 'einszwei'
1000 FOR UPDATE OF a1;
1001 <waiting ...>
1002 step c2: COMMIT;
1003 step lockwithvalues: <... completed>
1004 accountid|balance|balance2|id
1005 ---------+-------+--------+--------
1006 checking | 1050| 2100|checking
1007 savings | 600| 1200|savings
1008 (2 rows)
1009
1010 step c1: COMMIT;
1011 step read: SELECT * FROM accounts ORDER BY accountid;
1012 accountid|balance|balance2
1013 ---------+-------+--------
1014 checking | 1050| 2100
1015 savings | 600| 1200
1016 (2 rows)
1017
1018
1019 starting permutation: wx2_ext partiallock_ext c2 c1 read_ext
1020 step wx2_ext: UPDATE accounts_ext SET balance = balance + 450;
1021 step partiallock_ext:
1022 SELECT * FROM accounts_ext a1, accounts_ext a2
1023 WHERE a1.accountid = a2.accountid
1024 FOR UPDATE OF a1;
1025 <waiting ...>
1026 step c2: COMMIT;
1027 step partiallock_ext: <... completed>
1028 accountid|balance|other|newcol|newcol2|accountid|balance|other|newcol|newcol2
1029 ---------+-------+-----+------+-------+---------+-------+-----+------+-------
1030 checking | 1050|other| 42| |checking | 600|other| 42|
1031 savings | 1150| | 42| |savings | 700| | 42|
1032 (2 rows)
1033
1034 step c1: COMMIT;
1035 step read_ext: SELECT * FROM accounts_ext ORDER BY accountid;
1036 accountid|balance|other|newcol|newcol2
1037 ---------+-------+-----+------+-------
1038 checking | 1050|other| 42|
1039 savings | 1150| | 42|
1040 (2 rows)
1041
1042
1043 starting permutation: updateforss readforss c1 c2
1044 step updateforss:
1045 UPDATE table_a SET value = 'newTableAValue' WHERE id = 1;
1046 UPDATE table_b SET value = 'newTableBValue' WHERE id = 1;
1047
1048 step readforss:
1049 SELECT ta.id AS ta_id, ta.value AS ta_value,
1050 (SELECT ROW(tb.id, tb.value)
1051 FROM table_b tb WHERE ta.id = tb.id) AS tb_row
1052 FROM table_a ta
1053 WHERE ta.id = 1 FOR UPDATE OF ta;
1054 <waiting ...>
1055 step c1: COMMIT;
1056 step readforss: <... completed>
1057 ta_id|ta_value |tb_row
1058 -----+--------------+---------------
1059 1|newTableAValue|(1,tableBValue)
1060 (1 row)
1061
1062 step c2: COMMIT;
1063
1064 starting permutation: updateforcip updateforcip2 c1 c2 read_a
1065 step updateforcip:
1066 UPDATE table_a SET value = NULL WHERE id = 1;
1067
1068 step updateforcip2:
1069 UPDATE table_a SET value = COALESCE(value, (SELECT text 'newValue')) WHERE id = 1;
1070 <waiting ...>
1071 step c1: COMMIT;
1072 step updateforcip2: <... completed>
1073 step c2: COMMIT;
1074 step read_a: SELECT * FROM table_a ORDER BY id;
1075 id|value
1076 --+--------
1077 1|newValue
1078 (1 row)
1079
1080
1081 starting permutation: updateforcip updateforcip3 c1 c2 read_a
1082 step updateforcip:
1083 UPDATE table_a SET value = NULL WHERE id = 1;
1084
1085 step updateforcip3:
1086 WITH d(val) AS (SELECT text 'newValue' FROM generate_series(1,1))
1087 UPDATE table_a SET value = COALESCE(value, (SELECT val FROM d)) WHERE id = 1;
1088 <waiting ...>
1089 step c1: COMMIT;
1090 step updateforcip3: <... completed>
1091 step c2: COMMIT;
1092 step read_a: SELECT * FROM table_a ORDER BY id;
1093 id|value
1094 --+--------
1095 1|newValue
1096 (1 row)
1097
1098
1099 starting permutation: wrtwcte readwcte c1 c2
1100 step wrtwcte: UPDATE table_a SET value = 'tableAValue2' WHERE id = 1;
1101 step readwcte:
1102 WITH
1103 cte1 AS (
1104 SELECT id FROM table_b WHERE value = 'tableBValue'
1105 ),
1106 cte2 AS (
1107 SELECT * FROM table_a
1108 WHERE id = (SELECT id FROM cte1)
1109 FOR UPDATE
1110 )
1111 SELECT * FROM cte2;
1112 <waiting ...>
1113 step c1: COMMIT;
1114 step c2: COMMIT;
1115 step readwcte: <... completed>
1116 id|value
1117 --+------------
1118 1|tableAValue2
1119 (1 row)
1120
1121
1122 starting permutation: wrjt selectjoinforupdate c2 c1
1123 step wrjt: UPDATE jointest SET data = 42 WHERE id = 7;
1124 step selectjoinforupdate:
1125 set local enable_nestloop to 0;
1126 set local enable_hashjoin to 0;
1127 set local enable_seqscan to 0;
1128 explain (costs off)
1129 select * from jointest a join jointest b on a.id=b.id for update;
1130 select * from jointest a join jointest b on a.id=b.id for update;
1131 <waiting ...>
1132 step c2: COMMIT;
1133 step selectjoinforupdate: <... completed>
1134 QUERY PLAN
1135 ----------------------------------------------------------
1136 LockRows
1137 -> Merge Join
1138 Merge Cond: (a.id = b.id)
1139 -> Index Scan using jointest_id_idx on jointest a
1140 -> Index Scan using jointest_id_idx on jointest b
1141 (5 rows)
1142
1143 id|data|id|data
1144 --+----+--+----
1145 1| 0| 1| 0
1146 2| 0| 2| 0
1147 3| 0| 3| 0
1148 4| 0| 4| 0
1149 5| 0| 5| 0
1150 6| 0| 6| 0
1151 7| 42| 7| 42
1152 8| 0| 8| 0
1153 9| 0| 9| 0
1154 10| 0|10| 0
1155 (10 rows)
1156
1157 step c1: COMMIT;
1158
1159 starting permutation: wrjt selectresultforupdate c2 c1
1160 step wrjt: UPDATE jointest SET data = 42 WHERE id = 7;
1161 step selectresultforupdate:
1162 select * from (select 1 as x) ss1 join (select 7 as y) ss2 on true
1163 left join table_a a on a.id = x, jointest jt
1164 where jt.id = y;
1165 explain (verbose, costs off)
1166 select * from (select 1 as x) ss1 join (select 7 as y) ss2 on true
1167 left join table_a a on a.id = x, jointest jt
1168 where jt.id = y for update of jt, ss1, ss2;
1169 select * from (select 1 as x) ss1 join (select 7 as y) ss2 on true
1170 left join table_a a on a.id = x, jointest jt
1171 where jt.id = y for update of jt, ss1, ss2;
1172 <waiting ...>
1173 step c2: COMMIT;
1174 step selectresultforupdate: <... completed>
1175 x|y|id|value |id|data
1176 -+-+--+-----------+--+----
1177 1|7| 1|tableAValue| 7| 0
1178 (1 row)
1179
1180 QUERY PLAN
1181 --------------------------------------------------------------------
1182 LockRows
1183 Output: 1, 7, a.id, a.value, jt.id, jt.data, jt.ctid, a.ctid
1184 -> Nested Loop Left Join
1185 Output: 1, 7, a.id, a.value, jt.id, jt.data, jt.ctid, a.ctid
1186 -> Nested Loop
1187 Output: jt.id, jt.data, jt.ctid
1188 -> Seq Scan on public.jointest jt
1189 Output: jt.id, jt.data, jt.ctid
1190 Filter: (jt.id = 7)
1191 -> Result
1192 -> Seq Scan on public.table_a a
1193 Output: a.id, a.value, a.ctid
1194 Filter: (a.id = 1)
1195 (13 rows)
1196
1197 x|y|id|value |id|data
1198 -+-+--+-----------+--+----
1199 1|7| 1|tableAValue| 7| 42
1200 (1 row)
1201
1202 step c1: COMMIT;
1203
1204 starting permutation: wrtwcte multireadwcte c1 c2
1205 step wrtwcte: UPDATE table_a SET value = 'tableAValue2' WHERE id = 1;
1206 step multireadwcte:
1207 WITH updated AS (
1208 UPDATE table_a SET value = 'tableAValue3' WHERE id = 1 RETURNING id
1209 )
1210 SELECT (SELECT id FROM updated) AS subid, * FROM updated;
1211 <waiting ...>
1212 step c1: COMMIT;
1213 step c2: COMMIT;
1214 step multireadwcte: <... completed>
1215 subid|id
1216 -----+--
1217 1| 1
1218 (1 row)
1219
1220
1221 starting permutation: tid1 tid2 c1 c2 read
1222 step tid1: UPDATE accounts SET balance = balance + 100 WHERE ctid = '(0,1)' RETURNING accountid, balance;
1223 accountid|balance
1224 ---------+-------
1225 checking | 700
1226 (1 row)
1227
1228 step tid2: UPDATE accounts SET balance = balance + 200 WHERE ctid = '(0,1)' RETURNING accountid, balance; <waiting ...>
1229 step c1: COMMIT;
1230 step tid2: <... completed>
1231 accountid|balance
1232 ---------+-------
1233 (0 rows)
1234
1235 step c2: COMMIT;
1236 step read: SELECT * FROM accounts ORDER BY accountid;
1237 accountid|balance|balance2
1238 ---------+-------+--------
1239 checking | 700| 1400
1240 savings | 600| 1200
1241 (2 rows)
1242
1243
1244 starting permutation: tid1 tidsucceed2 c1 c2 read
1245 step tid1: UPDATE accounts SET balance = balance + 100 WHERE ctid = '(0,1)' RETURNING accountid, balance;
1246 accountid|balance
1247 ---------+-------
1248 checking | 700
1249 (1 row)
1250
1251 step tidsucceed2: UPDATE accounts SET balance = balance + 200 WHERE ctid = '(0,1)' OR ctid = '(0,3)' RETURNING accountid, balance; <waiting ...>
1252 step c1: COMMIT;
1253 step tidsucceed2: <... completed>
1254 accountid|balance
1255 ---------+-------
1256 checking | 900
1257 (1 row)
1258
1259 step c2: COMMIT;
1260 step read: SELECT * FROM accounts ORDER BY accountid;
1261 accountid|balance|balance2
1262 ---------+-------+--------
1263 checking | 900| 1800
1264 savings | 600| 1200
1265 (2 rows)
1266
1267
1268 starting permutation: tidrange1 tidrange2 c1 c2 read
1269 step tidrange1: UPDATE accounts SET balance = balance + 100 WHERE ctid BETWEEN '(0,1)' AND '(0,1)' RETURNING accountid, balance;
1270 accountid|balance
1271 ---------+-------
1272 checking | 700
1273 (1 row)
1274
1275 step tidrange2: UPDATE accounts SET balance = balance + 200 WHERE ctid BETWEEN '(0,1)' AND '(0,1)' RETURNING accountid, balance; <waiting ...>
1276 step c1: COMMIT;
1277 step tidrange2: <... completed>
1278 accountid|balance
1279 ---------+-------
1280 (0 rows)
1281
1282 step c2: COMMIT;
1283 step read: SELECT * FROM accounts ORDER BY accountid;
1284 accountid|balance|balance2
1285 ---------+-------+--------
1286 checking | 700| 1400
1287 savings | 600| 1200
1288 (2 rows)
1289
1290
1291 starting permutation: tid1 tid2 r1 c2 read
1292 step tid1: UPDATE accounts SET balance = balance + 100 WHERE ctid = '(0,1)' RETURNING accountid, balance;
1293 accountid|balance
1294 ---------+-------
1295 checking | 700
1296 (1 row)
1297
1298 step tid2: UPDATE accounts SET balance = balance + 200 WHERE ctid = '(0,1)' RETURNING accountid, balance; <waiting ...>
1299 step r1: ROLLBACK;
1300 step tid2: <... completed>
1301 accountid|balance
1302 ---------+-------
1303 checking | 800
1304 (1 row)
1305
1306 step c2: COMMIT;
1307 step read: SELECT * FROM accounts ORDER BY accountid;
1308 accountid|balance|balance2
1309 ---------+-------+--------
1310 checking | 800| 1600
1311 savings | 600| 1200
1312 (2 rows)
1313
1314
1315 starting permutation: simplepartupdate conditionalpartupdate c1 c2 read_part
1316 step simplepartupdate:
1317 update parttbl set b = b + 10;
1318
1319 step conditionalpartupdate:
1320 update parttbl set c = -c where b < 10;
1321 <waiting ...>
1322 step c1: COMMIT;
1323 step conditionalpartupdate: <... completed>
1324 step c2: COMMIT;
1325 step read_part: SELECT * FROM parttbl ORDER BY a, c;
1326 a| b|c| d
1327 -+--+-+----
1328 1|11|1| 12
1329 2|12|2|1014
1330 (2 rows)
1331
1332
1333 starting permutation: simplepartupdate complexpartupdate c1 c2 read_part
1334 step simplepartupdate:
1335 update parttbl set b = b + 10;
1336
1337 step complexpartupdate:
1338 with u as (update parttbl set b = b + 1 returning parttbl.*)
1339 update parttbl p set b = u.b + 100 from u where p.a = u.a;
1340 <waiting ...>
1341 step c1: COMMIT;
1342 step complexpartupdate: <... completed>
1343 step c2: COMMIT;
1344 step read_part: SELECT * FROM parttbl ORDER BY a, c;
1345 a| b|c| d
1346 -+--+-+----
1347 1|12|1| 13
1348 2|13|2|1015
1349 (2 rows)
1350
1351
1352 starting permutation: simplepartupdate_route1to2 complexpartupdate_route_err1 c1 c2 read_part
1353 step simplepartupdate_route1to2:
1354 update parttbl set a = 2 where c = 1 returning *;
1355
1356 a|b|c| d
1357 -+-+-+----
1358 2|1|1|1003
1359 (1 row)
1360
1361 step complexpartupdate_route_err1:
1362 with u as (update another_parttbl set a = 1 returning another_parttbl.*)
1363 update parttbl p set a = u.a from u where p.a = u.a and p.c = 1 returning p.*;
1364 <waiting ...>
1365 step c1: COMMIT;
1366 step complexpartupdate_route_err1: <... completed>
1367 ERROR: tuple to be locked was already moved to another partition due to concurrent update
1368 step c2: COMMIT;
1369 step read_part: SELECT * FROM parttbl ORDER BY a, c;
1370 a|b|c| d
1371 -+-+-+----
1372 2|1|1|1003
1373 2|2|2|1004
1374 (2 rows)
1375
1376
1377 starting permutation: simplepartupdate_noroute complexpartupdate_route c1 c2 read_part
1378 step simplepartupdate_noroute:
1379 update parttbl set b = 2 where c = 1 returning *;
1380
1381 a|b|c|d
1382 -+-+-+-
1383 1|2|1|3
1384 (1 row)
1385
1386 step complexpartupdate_route:
1387 with u as (update another_parttbl set a = 1 returning another_parttbl.*)
1388 update parttbl p set a = p.b from u where p.a = u.a and p.c = 1 returning p.*;
1389 <waiting ...>
1390 step c1: COMMIT;
1391 step complexpartupdate_route: <... completed>
1392 a|b|c| d
1393 -+-+-+----
1394 2|2|1|1004
1395 (1 row)
1396
1397 step c2: COMMIT;
1398 step read_part: SELECT * FROM parttbl ORDER BY a, c;
1399 a|b|c| d
1400 -+-+-+----
1401 2|2|1|1004
1402 2|2|2|1004
1403 (2 rows)
1404
1405
1406 starting permutation: simplepartupdate_noroute complexpartupdate_doesnt_route c1 c2 read_part
1407 step simplepartupdate_noroute:
1408 update parttbl set b = 2 where c = 1 returning *;
1409
1410 a|b|c|d
1411 -+-+-+-
1412 1|2|1|3
1413 (1 row)
1414
1415 step complexpartupdate_doesnt_route:
1416 with u as (update another_parttbl set a = 1 returning another_parttbl.*)
1417 update parttbl p set a = 3 - p.b from u where p.a = u.a and p.c = 1 returning p.*;
1418 <waiting ...>
1419 step c1: COMMIT;
1420 step complexpartupdate_doesnt_route: <... completed>
1421 a|b|c|d
1422 -+-+-+-
1423 1|2|1|3
1424 (1 row)
1425
1426 step c2: COMMIT;
1427 step read_part: SELECT * FROM parttbl ORDER BY a, c;
1428 a|b|c| d
1429 -+-+-+----
1430 1|2|1| 3
1431 2|2|2|1004
1432 (2 rows)
1433
1434
1435 starting permutation: sys1 sysupd2 c1 c2
1436 step sys1:
1437 UPDATE pg_class SET reltuples = 123 WHERE oid = 'accounts'::regclass;
1438
1439 step sysupd2:
1440 UPDATE pg_class SET reltuples = reltuples * 2
1441 WHERE oid = 'accounts'::regclass;
1442 <waiting ...>
1443 step c1: COMMIT;
1444 step sysupd2: <... completed>
1445 step c2: COMMIT;
1446
1447 starting permutation: sys1 sysmerge2 c1 c2
1448 step sys1:
1449 UPDATE pg_class SET reltuples = 123 WHERE oid = 'accounts'::regclass;
1450
1451 step sysmerge2:
1452 MERGE INTO pg_class
1453 USING (SELECT 'accounts'::regclass AS o) j
1454 ON o = oid
1455 WHEN MATCHED THEN UPDATE SET reltuples = reltuples * 2;
1456 <waiting ...>
1457 step c1: COMMIT;
1458 step sysmerge2: <... completed>
1459 step c2: COMMIT;
1460
1461 starting permutation: s1pp1 s2pp1 s2pp2 s2pp3 c1 c2
1462 step s1pp1: UPDATE another_parttbl SET b = b + 1 WHERE a = 1;
1463 step s2pp1: SET plan_cache_mode TO force_generic_plan;
1464 step s2pp2: PREPARE epd AS DELETE FROM another_parttbl WHERE a = $1;
1465 step s2pp3: EXECUTE epd(1); <waiting ...>
1466 step c1: COMMIT;
1467 step s2pp3: <... completed>
1468 step c2: COMMIT;
1469
1470 starting permutation: s1pp1 s2pp4 c1 c2
1471 step s1pp1: UPDATE another_parttbl SET b = b + 1 WHERE a = 1;
1472 step s2pp4: DELETE FROM another_parttbl WHERE a = (SELECT 1); <waiting ...>
1473 step c1: COMMIT;
1474 step s2pp4: <... completed>
1475 step c2: COMMIT;
1476
1477 starting permutation: updateformergevalues mergevalues c1 c2 read
1478 step updateformergevalues: UPDATE accounts SET balance = balance + 100;
1479 step mergevalues:
1480 MERGE INTO accounts
1481 USING (VALUES ('checking', 610), ('savings', 620)) v(accountid, balance)
1482 ON v.accountid = accounts.accountid
1483 WHEN MATCHED THEN UPDATE SET balance = v.balance
1484 WHEN NOT MATCHED THEN INSERT VALUES ('unmatched', -1);
1485 <waiting ...>
1486 step c1: COMMIT;
1487 step mergevalues: <... completed>
1488 step c2: COMMIT;
1489 step read: SELECT * FROM accounts ORDER BY accountid;
1490 accountid|balance|balance2
1491 ---------+-------+--------
1492 checking | 610| 1220
1493 savings | 620| 1240
1494 (2 rows)
1495