For a materialized view which is in manual refresh mode, what is the best approach to use REFRESH MATERIALIZED VIEW from inside a trigger.
REFRESH MATERIALIZED VIEW will commit the data, which for me broke the overall logic.
So how to overcome this limitation and still refresh the view triggered by a trigger.
Immediate refresh mode is not possible to use, because my materialized view has no unique index column.
Request clarification before answering.
Put the refresh in an EVENT and use TRIGGER EVENT in the trigger.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Put the TRIGGER EVENT inside a procedure owned by DBA, and GRANT EXECUTE on that procedure... procedures run with the permissions of the owner rather than the caller.
I would bother when it is used inside a trigger (as it is the case here), as I would assume
Additionally, I do assume that the trigger is a statement-level one, otherwise it could be called several times for one DML statement.
If this is a rarely modified table, well, then my point is surely moot.
...at least that's the DEFAULT - cf. this other FAQ on the SQL SECURITY INVOKER clause...
(which I have never used in production code...)
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.