DO $do$ BEGIN 
IF EXISTS(select * FROM pg_extension WHERE extname='srm_funct') 
THEN 
    alter extension srm_funct update;
else 
    create extension srm_funct;
end if;
END $do$;