Anyone know how I can manually set a jwt for auth ...
# sql
k
Anyone know how I can manually set a jwt for auth in sql? I want to run an explain command against a query but as an auth’d user so I can test RLS performance
e
this works for me from pgadmin connected as a login with `SUPERUSER`:
Copy code
set local role authenticated;
set local request.jwt.claim.sub = '<uid>';
SELECT * FROM foos;
k
ohh seems so straightforward now lol!
e
does not work from the supabase dashboard sql editor
k
yeah makes sense!
thanks for the help!
doesn't seem like any of the logins are default
SUPERUSER
roles. Did you have to make a new role that was a superuser?
ah fixed it by setting my postgres user to superuser via the sql editor in browser
e
huh, i haven't used discord threads. strange that i didn't get notified on posts ITT
i created a new login with
SUPERUSER
privileges
generally i try not to change anything originally created/managed by supabase. at one point
postgres
did have
SUPERUSER
, which was subsequently removed, i imagine deliberately? not sure if granting
SUPERUSER
to
postgres
could have subtle implications