Hi guys, I was trying to do http post request in ...
# help
d
Hi guys, I was trying to do http post request in postgres function. But I get the following error. Please provide your expertise 🙏
function http_post(unknown, unknown, unknown) does not exist
What I did? - Turn on HTTP extension - Sample Function
Copy code
create or replace function public.handle_new_user() 
returns trigger 
language plpgsql 
security definer 
as $$
begin
  select 
   "status", "content"::jsonb
     from  http_post(
    'https://app.doneo.io:5000/notification',
    '{"user": new.email,"provider":new.provider}',
    'application/json'
  );
  return new;
end;
$$;
n
Hello @dipesh! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
try adding
Copy code
SET search_path = extensions, public, pg_temp;
n
dipesh (2022-05-21)
g
after security definer
d
Thanks it works.
n
Thread was archived by @dipesh. Anyone can send a message to unarchive it.