What is the purpose of UPDATE permission
if it does not allow to update without SELECT permission
?
Generally, I understand that update internally causes select to find target rows, but this "internal select" does not leak to a user, so it is unclear if it is a bug or there is a "deeper meaning" of that.
Assume initially my_user
has only USAGE on my_schema
and no grants on my_table
Case 1:
GRANT UPDATE ON TABLE my_schema.my_table TO my_user;
UPDATE my_table
SET my_col = 'X';
>> SQL Error [42501]: ERROR: permission denied for table my_table
Case 2:
GRANT SELECT ON TABLE my_schema.my_table TO my_user;
GRANT UPDATE ON TABLE my_schema.my_table TO my_user;
UPDATE my_table
SET my_col = 'X';
>> SUCCESS