DROP ROLE IF EXISTS joe;

CREATE ROLE joe LOGIN;
CREATE TABLE colors (name text, visible bool);

CREATE OR REPLACE VIEW v_colors_1 WITH (security_barrier) AS
    SELECT * FROM colors WHERE (name in ('blue', 'green', 'yellow'))
    WITH CHECK OPTION;

CREATE OR REPLACE VIEW v_colors_2 AS
    SELECT * FROM colors WHERE (name in ('blue', 'green', 'yellow'))
    WITH CHECK OPTION;

GRANT ALL ON v_colors_1, v_colors_2 TO joe;

\c - joe

INSERT INTO v_colors_1 (name, visible) VALUES ('blue', false);
INSERT INTO v_colors_2 (name, visible) VALUES ('blue', false);
