Inconsistent Access to information_schema via Supabase JavaScript Client #23314
Unanswered
RaoulRSDSchipper
asked this question in
Questions
Replies: 1 comment
-
You can check the permissions for the Have you also confirmed that the function is being run as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm working on a TypeScript project and trying to retrieve foreign key details for tables in my public schema using a PostgreSQL function. The function executes as expected when run directly in the SQL editor, but it returns an empty array without any errors when I try to fetch it using the JavaScript client with the service role key.
Here is the function definition:
Interestingly, another function that queries information_schema.columns returns results successfully when executed from the JavaScript client using the service role key:
This inconsistency leads me to wonder if there are restrictions or permissions specifically affecting the table_constraints, key_column_usage, and constraint_column_usage views in information_schema that do not apply to the columns view.
Could there be specific permissions on the service role that restrict access to certain information_schema tables but not others? How should such permissions be configured or verified within Supabase to ensure consistent access through the JavaScript client?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions