This content has been marked as final. Show 3 replies
Yes table can be locked this way. One of ways to circumvent is via a view..
create view owner.t_view as
select * from table_name
select * from table_name where 1=2;
select * owner.t_view for update would fail.
Well - that is certainly interesting. I can reproduce it on vanilla 22.214.171.124 also.
I can't think of why the FOR UPDATE should be permitted if the user cannot update the table.
This seems to be the specification, this behavior is same from old version.
(And I can reproduce this behavior at 10.1.0.5, 126.96.36.199)
If you want to avoid, You should create a VIEW with READ ONLY.
<<SELECT FOR UPDATE
But PostgreS needs update priv for "select for update"..