How to do HTTP Request on the mart scheme?
Hi everyone,
I have a table mart.dim_product inside a custom schema mart.
The schema is included in pgrst.schemas (public,mart), and I’ve granted full privileges (USAGE, SELECT, etc.) to postgres, service_role, and authenticated.
However, the Supabase REST API still returns "relation 'public.dim_product' does not exist" — it seems PostgREST doesn’t recognize the table in the mart schema even though the configuration looks correct.
Restarting the project and running NOTIFY pgrst, 'reload schema'; didn’t help.
Any ideas why the REST API can’t access tables outside the public schema?
9 Replies
Goto Data API settings. Add schema to be API accessible.
EDIT: I see you are trying to set pgrst.schemas. How did you set that or think your are?
What is the error?
I added the schema to in the settings thank you.
https://<SUPABASE_PROJECT_URL>/rest/v1/dim_product
Is the URL right or do I need to integrate the schema into the URL?

What is your query on that?
Yes you do have to use .schema()
URL: https://<SUPABASE_PROJECT_URL>/rest/v1/dim_product
Header (Authorization and apikey)
Should I add it in the URL or query?
If you are generating the http request directly, it is more complicated.
You have to set some header.
Supabase-js and the other clients handle that for you with .schema().
No I wanted to use it directly via HTTP
Then you need to read the API docs...
https://docs.postgrest.org/en/stable/references/api/schemas.html
PostgREST 14
Schemas
PostgREST can expose a single or multiple schema’s tables, views and functions. The active database role must have the usage privilege on the schemas to access them. Single schema: To expose a single schema, specify a single value in db-schemas. This schema is added to the search_path of every re...
There are two different headers depending on your request type.
If you plan on using the REST API directly you will need to refer to that site often.
Perfect, thank you so much. I solved it.