Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit55e6dfd

Browse files
committed
execute SELECT FOR UPDATE on view (pathman_views)
1 parentbd2e71c commit55e6dfd

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

‎expected/pathman_views.out

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,21 @@ explain (costs off) select * from views.abc where id = 1;
5656
Filter: (id = 1)
5757
(3 rows)
5858

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+
5974
select count (*) from views.abc;
6075
count
6176
-------

‎expected/pathman_views_1.out

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,41 @@ explain (costs off) select * from views.abc where id = 1;
5656
Filter: (id = 1)
5757
(3 rows)
5858

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+
5994
select count (*) from views.abc;
6095
count
6196
-------

‎sql/pathman_views.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ execute procedure views.disable_modification();
4040
/* Test SELECT*/
4141
explain (costs off)select*fromviews.abc;
4242
explain (costs off)select*fromviews.abcwhere id=1;
43+
explain (costs off)select*fromviews.abcwhere id=1 forupdate;
44+
select*fromviews.abcwhere id=1 forupdate;
4345
selectcount (*)fromviews.abc;
4446

4547

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp