Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019057Openbravo ERPY. DBSourceManagerpublic2011-11-14 08:222011-11-14 16:44
neil_smith 
marvintm 
highmajoralways
newopen 
5
3.0MP4.1 
 
Core
No
0019057: DO INSTEAD on view
When working with views, it is not possible to delete/update/insert on them (in PostgreSQL).
There is a way to bypass this problem by creating a 'DO INSTEAD' rule on the view such as reported in the postgreSQL documentation

CREATE RULE name
     AS ON event
     TO object [ WHERE condition ]
     DO [ INSTEAD ] [ action | NOTHING ]

in my case, 'name' is the name of my rule, 'event' is DELETE, 'object' is my view and the action is 'DO INSTEAD DELETE FROM ...'

When the context is exported (ant export.database), this rule is not exported. This causes a big problem because after each update, the rule is lost and I have to recreate it manually.
1. Create the rule
2. ant export.database
3. the rule is deleted from in the database
The rules have to be saved with the context (export.database)
No tags attached.
Issue History
2011-11-14 08:22neil_smithNew Issue
2011-11-14 08:22neil_smithAssigned To => alostale
2011-11-14 08:22neil_smithModules => Core
2011-11-14 12:01shuehnerCategory00. Application dictionary => Y. DBSourceManager
2011-11-14 12:01shuehnerTypedefect => feature request
2011-11-14 16:44alostaleAssigned Toalostale => marvintm

There are no notes attached to this issue.