Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseβ€’4y agoβ€’
12 replies
tyakymiuk

Is there any way to access auth object in postgres functions?

Hey!

wondering if there's a way to access
auth
auth
object inside postgres function that's being called via RPC just like we're accessing
auth.uid()
auth.uid()
in e.g. RLS policies. If the answer is
yes, it's possible
yes, it's possible
maybe you also know a way how to access it using
plv8
plv8
language for writing those functions? Maybe there's a reserved word for it

As a side question: are there any drawbacks in using .rpc() instead of .select() all the way through? (Just like endpoints and perform all the validations, checks, etc. there)
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

is there way to version functions?
SupabaseSSupabase / help-and-questions
4y ago
Auth error messages: is there a list of them? Or a way to access an object?
SupabaseSSupabase / help-and-questions
3y ago
Is there any way to generate an auth session without credentials?
SupabaseSSupabase / help-and-questions
4y ago
'Direct' Postgres Connection - any way to ensure that access policies apply?
SupabaseSSupabase / help-and-questions
4y ago