CREATE FUNCTION admin.select_organization_by_name(org_name text) RETURNS SETOF public.organizations
    LANGUAGE plpgsql SECURITY DEFINER
    AS $$
BEGIN
	RETURN QUERY SELECT id,name FROM organizations WHERE name=org_name;
	IF NOT FOUND THEN
		RAISE EXCEPTION 'Organization with name % not found', org_name;
	END IF;

	RETURN;
END
$$;

CREATE OR REPLACE FUNCTION admin.select_organization_by_name(org_name text) RETURNS SETOF public.organizations
    LANGUAGE plpgsql SECURITY DEFINER
    AS $$
BEGIN
	RETURN QUERY SELECT id,name FROM organizations WHERE name=org_name;
	IF NOT FOUND THEN
		RAISE EXCEPTION 'Organization with name % not found', org_name;
	END IF;

	RETURN;
END
$$;

CREATE OR REPLACE FUNCTION on that file
CREATE OR REPLACE FUNCTION on that file

Signed-off-by: Michael Casadevall <6fe105eefab41990d7ec714c6c25ade3095cdb48@them.com>
