How do I refactor my RPC so that it returns nothing?

I'm designing a mailing list from scratch and everything is working fine. I have RLS setup only for inserts and nothing else.

I want my RPC function to not return anything. I'm new to plpgsql so not sure how to refactor this. Any help is appreciated.

create or replace function join_mailing_list(email text)
returns mailing_list as $$
  declare
    v_request mailing_list;
  begin
    insert into mailing_list(email)
    values(join_mailing_list.email)
    returning * into v_request;

    return v_request;
  end;
$$ language plpgsql security definer;
Was this page helpful?