I created tables mails_outside, contacts_firm and contacts_outside. Now I want to make a materialized view based on them, so the user will have access to mails only related to himself. I want it to refresh on every commit, so the best would be fast refresh, but for some reason, I cannot make it, because "The materialized view did not satisfy conditions for refresh at commit time." Of course I created materialized view logs. Is there any way to make this view work?
materialized view
CREATE MATERIALIZED VIEW MV_US1_OUTSIDE
REFRESH FAST
ON COMMIT
AS
SELECT mo.rowid AS mo_rowid,
cf.rowid AS cf_rowid,
co.rowid AS co_rowid,
mo.arrival_date,
co.address,
co.last_name || ' ' || co.first_name name,
mo.message
FROM mails_outside mo, contacts_firm cf, contacts_outside co
WHERE mo.id_receiver = cf.id_contact
AND mo.id_sender = co.id_contact
AND cf.nick_name = user;
materialized view logs
CREATE MATERIALIZED VIEW LOG ON mails_outside
WITH rowid
INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW LOG ON contacts_firm
WITH rowid
INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW LOG ON contacts_outside
WITH rowid
INCLUDING NEW VALUES;