PostgreSQL drop view in case of unknown whether materialized or not
My solution at this point is a function 

CREATE OR REPLACE FUNCTION dropview(IN view_schema TEXT, IN view2drop TEXT)
RETURNS void
LANGUAGE plpgsql
AS 
$$
DECLARE drop_stmnt VARCHAR;
BEGIN
SELECT 
    CASE
        WHEN relkind = 'm' THEN 'MATERIALIZED VIEW'
        WHEN relkind = 'v' THEN 'VIEW'
    END
FROM pg_class
WHERE relname = view2drop
INTO drop_stmnt;

EXECUTE 'DROP ' || drop_stmnt || ' IF EXISTS ' || view_schema ||'.'|| view2drop || ';';
END;
$$;


so that with

SELECT dropview('myschema', 'myview');


doesn't have to care about MATERIALIZED VIEW or VIEW.