Skip to content

UPDATE and DELETE requires SELECT permission #2423

Answered by steve-chavez
dshukertjr asked this question in Q&A
Discussion options

You must be logged in to vote

Hm, since you don't have a SELECT policy defined and you do:

  .eq('id', 1)

That means you're not getting any rows to update. Try just selecting the data, you should get zero rows as well.

The solution should be creating a SELECT policy.


Doing it at the SQL level should give you the same results:

begin;
set local role anon;
update products set name = 'new name' where id = 1;
UPDATE 0
commit;

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@steve-chavez
Comment options

@steve-chavez
Comment options

@dshukertjr
Comment options

Answer selected by dshukertjr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2421 on August 11, 2022 15:52.