Following on from this earlier question I\'m on PostgreSQL 8.4 and am having trouble with updatable views.
I have a view:
CREATE VIEW filedata_view
A
Don't use a rule for this, but a trigger. You need at least version 9.1, older versions don't support triggers on views.
A trigger is a specification that the database should automatically execute a particular function whenever a certain type of operation is performed. Triggers can be attached to both tables and views.
On tables, triggers can be defined to execute either before or after any INSERT, UPDATE, or DELETE operation, either once per modified row, or once per SQL statement. UPDATE triggers can moreover be set to fire only if certain columns are mentioned in the SET clause of the UPDATE statement. Triggers can also fire for TRUNCATE statements. If a trigger event occurs, the trigger's function is called at the appropriate time to handle the event.
Rumor is that rules will be EOL in a while.