Project-specific PostgREST schema cache stuck – PGRST002 errors

Here’s a fully Markdown-formatted version you can copy-paste directly:
# PostgREST Schema Cache Issue – PGRST002

**Hi Supabase Support Team,**

I’m experiencing a persistent issue with one of my projects. All REST API queries via PostgREST return:
# PostgREST Schema Cache Issue – PGRST002

**Hi Supabase Support Team,**

I’m experiencing a persistent issue with one of my projects. All REST API queries via PostgREST return:
json { "response": { "error": { "code": "PGRST002", "details": null, "hint": null, "message": "Could not query the database for the schema cache. Retrying." }, "data": null, "count": null, "status": 503, "statusText": "Service Unavailable" } }
### Details

* Database is healthy. Direct SQL queries in the editor work, e.g.:
### Details

* Database is healthy. Direct SQL queries in the editor work, e.g.:
sql select * from packages_schema.general;
* This project uses a **custom schema** (`packages_schema`). Other Supabase projects work fine.
* Anonymous and service keys are verified and correct.
* Attempts made:

* Restarted the project multiple times.
* Confirmed schema exists and SQL queries work.
* Specified schema in NodeJS client:
* This project uses a **custom schema** (`packages_schema`). Other Supabase projects work fine.
* Anonymous and service keys are verified and correct.
* Attempts made:

* Restarted the project multiple times.
* Confirmed schema exists and SQL queries work.
* Specified schema in NodeJS client:
ts const supabase = createClient( process.env.SUPABASE_URL!, process.env.SUPABASE_ANON!, { db: { schema: "packages_schema" } } ); const { data, error } = await supabase.from("general").select("*");
→ Still fails with `PGRST002`.

* Issue started around **Aug 18, 2025**, shortly after the reported API incident related to `user_content` and dashboard SQL editor errors.

### Request

Could you please investigate and manually refresh or rebuild the PostgREST schema cache for this project? Other projects are working fine, so it seems to be a **project-specific cache problem**.

Thanks in advance for your help!
→ Still fails with `PGRST002`.

* Issue started around **Aug 18, 2025**, shortly after the reported API incident related to `user_content` and dashboard SQL editor errors.

### Request

Could you please investigate and manually refresh or rebuild the PostgREST schema cache for this project? Other projects are working fine, so it seems to be a **project-specific cache problem**.

Thanks in advance for your help!
This is concise, readable, and ready to paste into Supabase support.
```
24 Replies
garyaustin
garyaustin5d ago
You likely have the API turned off. Do you have your custom schema added to the API settings?
BLACKDREAM
BLACKDREAMOP5d ago
yes
BLACKDREAM
BLACKDREAMOP5d ago
i already added schema. i dont have any changes on my side it was working few days back now its not
No description
garyaustin
garyaustin5d ago
Is the API turned on? What is the status of PostgREST in upper rate of instance homepage?
BLACKDREAM
BLACKDREAMOP5d ago
No description
BLACKDREAM
BLACKDREAMOP5d ago
No description
garyaustin
garyaustin5d ago
Try a restart I guess. All that looks good.
BLACKDREAM
BLACKDREAMOP5d ago
did 2 times
garyaustin
garyaustin5d ago
Instead of using the schema option in the createClient can you do that with .schema('myschema').from('xxxx') instead as a test without major impact? I don't know of an issue with the createClient way, but not as common these days. I would expect a grant error if you did not set up your schema correctly, but maybe the error has changed. Is the role granted access to your schema? Check the Postgres logs.
BLACKDREAM
BLACKDREAMOP5d ago
on aug 13-16 --> working no code changes all backends were deployed and working aug 17-19 same code but now its not working
garyaustin
garyaustin5d ago
So nothing in the Postgres logs? What version of postgres? I've got no other ideas for you. Do you have a support request in?
BLACKDREAM
BLACKDREAMOP5d ago
iam on free plan so they dont provide team support so i reached community support and asked here
garyaustin
garyaustin5d ago
If your instance is messed up only they can solve it. I'm not saying it is though. Hard to debug as that error is very general. Try SQL impersonation for the schema.
BLACKDREAM
BLACKDREAMOP5d ago
you sure that will fix
garyaustin
garyaustin5d ago
I'm asking you to use the SQL editor impersonating the role you app call is using. I want to see if you get any sort of grant error.
BLACKDREAM
BLACKDREAMOP4d ago
const supabase = createClient(process.env.SUPABASE_URL as string, process.env.SUPABASE_ANON as string, { db : { schema : "packages_schema" } });
const supabase = createClient(process.env.SUPABASE_URL as string, process.env.SUPABASE_ANON as string, { db : { schema : "packages_schema" } });
packages_schema is granted
No description
No description
No description
garyaustin
garyaustin4d ago
In the SQL editor at bottom right see the user role. Change that to authenticated. Then select from packages_schema.general in the SQL editor.
BLACKDREAM
BLACKDREAMOP19h ago
i get data
No description
BLACKDREAM
BLACKDREAMOP18h ago
how do i reach to the internal tech team for solution chatgpt is saying
Supabase Internal Issue (Service Degradation)

Sometimes, Supabase’s internal PostgREST service (the API layer) can glitch independent of your database. It might work in the SQL editor but fail for API routes
Supabase Internal Issue (Service Degradation)

Sometimes, Supabase’s internal PostgREST service (the API layer) can glitch independent of your database. It might work in the SQL editor but fail for API routes
BLACKDREAM
BLACKDREAMOP18h ago
No description
garyaustin
garyaustin11h ago
You have to go thru support Are you on latest version of Postgres? Upgrading also upgrades PostgREST. Also try changing the API settings by removing the schema, save it, then adding it back in.
BLACKDREAM
BLACKDREAMOP11h ago
yes i did this just to be on the safe side after doing that i came to you i don't know how to do that
garyaustin
garyaustin11h ago
Go to the infrastructure tab in settings.

Did you find this page helpful?