Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0042080Openbravo ERPA. Platformpublic2019-10-22 09:482022-02-01 07:24
AugustoMauch 
Triage Platform Base 
normalminorhave not tried
newopen 
5
 
 
Core
No
0042080: Views are not being taken into account in the ad_db_modified function in PostgreSQL
The ad_db_modified function is used to detect if there are local changes in the database before updating it. It checks several database objects, like tables, functions, triggers, etc.

The problem is that in the postgresql version, views are not being taken into account. So, if someone creates a new view in the database, that view will be dropped the next time update.database is run, because the local changes will not be detected.
In an Openbravo environment that uses postgresql:
- Execute update.database to make sure there are no local changes to begin with.
- Add a new view, for instance:

    create view c_order_v as
    select * from c_order;
    
    ALTER TABLE public.c_order_v
      OWNER TO tad;
- Execute update.database again. It should fail because there are local changes in the database, but it does not detect them.
- Check that the view created in step 2 no longer exists:
select * from pg_class where relname ilike 'c_order_v'; (or \d c_order_v in psql)
No tags attached.
Issue History
2019-10-22 09:48AugustoMauchNew Issue
2019-10-22 09:48AugustoMauchAssigned To => platform
2019-10-22 09:48AugustoMauchModules => Core
2019-10-22 09:48AugustoMauchTriggers an Emergency Pack => No
2022-02-01 07:24alostaleAssigned Toplatform => Triage Platform Base

There are no notes attached to this issue.