Skip to content

Commit 55e6dfd

Browse files
committed
execute SELECT FOR UPDATE on view (pathman_views)
1 parent bd2e71c commit 55e6dfd

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 * from views.abc;
4242
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;
4345
select count (*) from views.abc;
4446

4547

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