What is a good way to parameterize a materialized view on Postgres?
There are three ways,


Use foreign data in a table that holds the inputs.
Make sell_date a function of the current time. Such as AND sell_date &gt; current_time - '5 days'.
If nothing depends on it, drop and reload a new ad-hoc MATERIALIZED VIEW by the same name in a transaction.