I have a materialized view in Postgres like
CREATE MATERIALIZED VIEW my_view AS SELECT * FROM my_table WHERE my_column NOT IN ('a', 'b', 'c');
But ('a', 'b', 'c') is part of my business logic, and I want to be able to make it into ('a', 'b', 'c', 'd') or ('a') without having to drop my_view and recreate it, since it has a bunch of dependent views. So I want to replace the definition of my_view to something like
CREATE MATERIALIZED VIEW my_view AS SELECT * FROM my_table WHERE my_column NOT IN my_unwanted_list();
And then my_unwanted_list would just return a constant that I could set to whatever I want by updating my_unwanted_list's definition. Then I can add an unwanted value just by updating my_unwanted_list and refreshing my_view.
But I am having some trouble getting the syntax right for my_unwanted_list. How do I write a PostgreSql function that returns something I can use in an IN filter?