https://supabase.com/ logo
#help
Title
# help
g

garyaustin

10/26/2021, 12:13 AM
Make sure you have insert with returning set to minimum or the insert does a read. At least in JS.
f

ferminrp

10/26/2021, 12:53 AM
I'm doing this, doesnt work on postam or js
Copy code
curl --location --request POST 'https://url.supabase.co/rest/v1/usuarios' \
--header 'apikey: abc' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data-raw '{ "dni": "111", "email": "probando","name":"gonzalo" }'
insert policy
g

garyaustin

10/26/2021, 12:58 AM
I'm not familiar with the format you are showing, but possibly return=representation means return the record. Try setting a RLS for select and see if it works then.
f

ferminrp

10/26/2021, 12:59 AM
with a rls for select it does work
will try switching the return off
g

garyaustin

10/26/2021, 12:59 AM
"By default, every time you run insert(), the client library will make a select to return the full record. This is convenient, but it can also cause problems if your Policies are not configured to allow the select operation. If you are using Row Level Security and you are encountering problems, try setting the returning param to minimal."
f

ferminrp

10/26/2021, 12:59 AM
that was it!!!!
you are a genius, thank you so much!
g

garyaustin

10/26/2021, 1:00 AM
They really should switch this as it is biting lots of people. Including me.
f

ferminrp

10/26/2021, 1:05 AM
seriously ... thank you ... was pulling my hair for the last couple of hours with this