To give a better idea:
DO $$
DECLARE v_string text = 'raise notice ''%'', ''this could be sql with if statement...'';';
BEGIN
if 1=1 then
raise notice '%', ' first notice has been raised...';
end if;
EXECUTE v_string;--this fails
END;
$$
LANGUAGE plpgsql;
I do not wish to create a function for each query I have.