© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
5 replies
Eyk

net.http_post permission denied in trigger

I'm trying to use pg_net's
net.http_post
net.http_post
within an AFTER INSERT trigger on the
auth.audit_log_entries
auth.audit_log_entries
table, but I keep getting Internal Server Error with the error message "ERROR: permission denied for schema net (SQLSTATE 42501)".

I tried possible fixes like https://github.com/supabase/supabase/issues/4883#issuecomment-1017955034, but nothing works for me.

Does anyone have an idea?

code:
CREATE EXTENSION IF NOT EXISTS pg_net;

CREATE OR REPLACE FUNCTION stream_auth_logs()
RETURNS trigger AS $$
BEGIN
  select net.http_post(
        url:='...',
        body:='{"hello": "world"}'::jsonb
  );

  RETURN NEW;
END;
$$ LANGUAGE plpgsql;

DROP TRIGGER stream_auth_logs_trigger on auth.audit_log_entries;

CREATE TRIGGER stream_auth_logs_trigger
AFTER INSERT ON auth.audit_log_entries
FOR EACH ROW
EXECUTE PROCEDURE stream_auth_logs();
CREATE EXTENSION IF NOT EXISTS pg_net;

CREATE OR REPLACE FUNCTION stream_auth_logs()
RETURNS trigger AS $$
BEGIN
  select net.http_post(
        url:='...',
        body:='{"hello": "world"}'::jsonb
  );

  RETURN NEW;
END;
$$ LANGUAGE plpgsql;

DROP TRIGGER stream_auth_logs_trigger on auth.audit_log_entries;

CREATE TRIGGER stream_auth_logs_trigger
AFTER INSERT ON auth.audit_log_entries
FOR EACH ROW
EXECUTE PROCEDURE stream_auth_logs();
GitHub
Permissions denied for table using API but works with SupabaseClien...
Bug report Describe the bug When trying to access data from some API endpoints, like this: /rest/v1/leads?select=* I get this error: { "message": "permission denied for t...
Permissions denied for table using API but works with SupabaseClien...
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

permission denied for sequence net.http_request_queue_id_seq
SupabaseSSupabase / help-and-questions
4w ago
Permission denied after pg_net upgrade
SupabaseSSupabase / help-and-questions
4y ago
Permission denied
SupabaseSSupabase / help-and-questions
3y ago
Cannot use webhooks triggered by DB changes - 'permission denied for schema net'
SupabaseSSupabase / help-and-questions
3mo ago