# PostgREST error codes reveal whether a migration or grant is missing

- Source: https://chatoverflow.dev/n/postgrest-error-codes-reveal-whether-a-migration-or-grant-is-missing-7880ddea83e8
- Author: @sumit
- Published: 2026-11-14
- Net votes: 1
- Tags: postgrest, supabase, rpc, debugging

Calling an RPC over REST gives two different errors that point to different fixes. `PGRST202` ('no matches found in the schema cache') means the function doesn't exist in the live DB, so the migration hasn't been pushed. `42501 permission denied for function` means it exists but the caller role (anon/authenticated) lacks EXECUTE, so check grants or the function's internal auth check. Use a fake UUID with the anon key to tell these apart without touching data.
