File tree 3 files changed +52
-0
lines changed
3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,21 @@ explain (costs off) select * from views.abc where id = 1;
56
56
Filter: (id = 1)
57
57
(3 rows)
58
58
59
+ explain (costs off) select * from views.abc where id = 1 for update;
60
+ QUERY PLAN
61
+ --------------------------------
62
+ LockRows
63
+ -> Append
64
+ -> Seq Scan on _abc_0
65
+ Filter: (id = 1)
66
+ (4 rows)
67
+
68
+ select * from views.abc where id = 1 for update;
69
+ id
70
+ ----
71
+ 1
72
+ (1 row)
73
+
59
74
select count (*) from views.abc;
60
75
count
61
76
-------
Original file line number Diff line number Diff line change @@ -56,6 +56,41 @@ explain (costs off) select * from views.abc where id = 1;
56
56
Filter: (id = 1)
57
57
(3 rows)
58
58
59
+ explain (costs off) select * from views.abc where id = 1 for update;
60
+ QUERY PLAN
61
+ --------------------------------
62
+ LockRows
63
+ -> Append
64
+ -> Seq Scan on _abc
65
+ Filter: (id = 1)
66
+ -> Seq Scan on _abc_0
67
+ Filter: (id = 1)
68
+ -> Seq Scan on _abc_1
69
+ Filter: (id = 1)
70
+ -> Seq Scan on _abc_2
71
+ Filter: (id = 1)
72
+ -> Seq Scan on _abc_3
73
+ Filter: (id = 1)
74
+ -> Seq Scan on _abc_4
75
+ Filter: (id = 1)
76
+ -> Seq Scan on _abc_5
77
+ Filter: (id = 1)
78
+ -> Seq Scan on _abc_6
79
+ Filter: (id = 1)
80
+ -> Seq Scan on _abc_7
81
+ Filter: (id = 1)
82
+ -> Seq Scan on _abc_8
83
+ Filter: (id = 1)
84
+ -> Seq Scan on _abc_9
85
+ Filter: (id = 1)
86
+ (24 rows)
87
+
88
+ select * from views.abc where id = 1 for update;
89
+ id
90
+ ----
91
+ 1
92
+ (1 row)
93
+
59
94
select count (*) from views.abc;
60
95
count
61
96
-------
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ execute procedure views.disable_modification();
40
40
/* Test SELECT */
41
41
explain (costs off) select * from views .abc ;
42
42
explain (costs off) select * from views .abc where id = 1 ;
43
+ explain (costs off) select * from views .abc where id = 1 for update ;
44
+ select * from views .abc where id = 1 for update ;
43
45
select count (* ) from views .abc ;
44
46
45
47
You can’t perform that action at this time.
0 commit comments