permission denied for schema public. 2 hours trying to solve it.
Hello everyona!
I'm working on an MVP and started integrating my backend with Supabase. However, after a lot of frustration, I decided to simplify things and ended up creating a file called
supabase_ping.py
to test why my select query isn’t working.
I’ve tested both the anon API key and the service API key, but in both cases I get a permission denied for schema public error. I’ve tried so many different things, but nothing has worked. The most informative error messages I’ve gotten are the following (the table name is messages, located at public.messages):
WARN: Query to 'messages' failed. Table may not exist or permissions denied.
Exception: Error 42501:
Message: permission denied for schema public
When I check the official troubleshooting page for this error: https://supabase.com/docs/guides/troubleshooting/database-api-42501-errors It shows this query:
select
cast(postgres_logs.timestamp as datetime) as timestamp,
event_message,
parsed.error_severity,
parsed.user_name,
parsed.query,
parsed.detail,
parsed.hint
from
postgres_logs
cross join unnest(metadata) as metadata
cross join unnest(metadata.parsed) as parsed
where
regexp_contains(parsed.error_severity, 'ERROR|FATAL|PANIC')
and parsed.sql_state_code = '42501'
order by timestamp desc
limit 100;
Returns this error:
ERROR: 42P01: relation "postgres_logs" does not exist
LINE 10: postgres_logs
I assumed postgres_logs would be a pre-built table.
What can I do?Supabase Docs | Troubleshooting | Database API 42501 errors
Supabase is the Postgres development platform providing all the backend features you need to build a product.
0 Replies